Messages in this thread Patch in this message | | | From | Tejun Heo <> | Subject | [PATCH 5/7] block: Remove superflous rcu_read_[un]lock_sched() in blk_queue_enter() | Date | Tue, 6 Mar 2018 09:33:14 -0800 |
| |
3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") added rcu_read_[un]lock_sched() to blk_queue_enter() along with other changes but it doesn't seem to be doing anything.
blk_queue_enter() is called with @q - the pointer to the target request_queue, so the caller obviously has to guarantee that @q can be dereferenced, and inside the RCU-sched protected area, there's nothing which needs further protection.
Let's remove the superflous rcu_read_[un]lock_sched().
Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Bart Van Assche <bart.vanassche@wdc.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> --- Hello, Bart.
This came up while auditing percpu_ref users for problematic RCU usages. I couldn't understand what the RCU protection was doing. It'd be great if you can take a look and tell me whether I missed something.
Thanks.
block/blk-core.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c index 6d82c4f..e3b4d1849 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -827,7 +827,6 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) bool success = false; int ret; - rcu_read_lock_sched(); if (percpu_ref_tryget_live(&q->q_usage_counter)) { /* * The code that sets the PREEMPT_ONLY flag is @@ -840,7 +839,6 @@ 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(); if (success) return 0; -- 2.9.5
| |