Hello,
On Mon, Mar 19, 2018 at 03:16:07PM +0000, Bart Van Assche wrote:
As explained in the comment in scsi_device_quiesce(), the effect of blk_set_preempt_only() must be visible for percpu_ref_tryget() calls that occur after the queue unfreeze triggered by scsi_device_quiesce(). Hence the RCU read lock calls in blk_queue_enter(). Since these RCU read lock calls surround a function call that uses rcu_read_lock_sched(), namely percpu_ref_tryget_live(), we have to use sched-RCU in both blk_queue_enter() and scsi_device_quiesce().
Let's please not depend on rcu_read_lock_sched() in percpu_ref_tryget_live(). That's an implementation detail. If the code needs RCU based synchronization, it should perform them explicitly.
Thanks.