Skip to contentSkip to conversation

block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}()

PATCH Superseded Bart Van Assche 2 participants 2 messages Mar 19, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Change a rcu_read_{lock,unlock}_sched() pair into rcu_read_{lock,unlock}()

Since neither the RCU-protected code in blk_queue_enter() nor blk_queue_usage_counter_release() sleeps, regular RCU protection is sufficient. Note: scsi_device_quiesce() does not have to be modified since it already uses synchronize_rcu().

Fixes 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably")
Cc Hannes Reinecke <[email protected]>
Cc Ming Lei <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Johannes Thumshirn <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Oleksandr Natalenko <[email protected]>
Cc Martin Steigerwald <[email protected]>
---
 block/blk-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-core.c +2 -2
index 5e88c579e896..a0f675f84f86 100644
@@ -917,7 +917,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 		bool success = false;
 		int ret;
 
-		rcu_read_lock_sched();
+		rcu_read_lock();
 		if (percpu_ref_tryget_live(&q->q_usage_counter)) {
 			/*
 			 * The code that sets the PREEMPT_ONLY flag is
@@ -930,7 +930,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 				percpu_ref_put(&q->q_usage_counter);
 			}
 		}
-		rcu_read_unlock_sched();
+		rcu_read_unlock();
 
 		if (success)
 			return 0;
Signature · 1 line
2.16.2
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bart Van Assche

Since neither the RCU-protected code in blk_queue_enter() nor blk_queue_usage_counter_release() sleeps, regular RCU protection is sufficient. Note: scsi_device_quiesce() does not have to be modified since it already uses synchronize_rcu().

Quoted 11 lines
Fixes 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably")
Cc Hannes Reinecke <[email protected]>
Cc Ming Lei <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Johannes Thumshirn <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Oleksandr Natalenko <[email protected]>
Cc Martin Steigerwald <[email protected]>

It'd be great to add a comment to clarify the pairing.

Thanks.

Signature · 1 line
tejun