summaryrefslogtreecommitdiff
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-27 10:31:57 +0300
committerJens Axboe <axboe@kernel.dk>2020-06-29 18:09:08 +0300
commit93b8063804b62b55248e16499d853e1b20eff905 (patch)
tree4bf81072242d6dfcc2e4e70fad9b83cfb52ad7b8 /block/blk-throttle.c
parent7582f30cc9fbcdcd630398bea010e5f6a2e2fcab (diff)
downloadlinux-93b8063804b62b55248e16499d853e1b20eff905.tar.xz
blk-cgroup: move rcu locking from blkcg_bio_issue_check to blk_throtl_bio
The only thing in blkcg_bio_issue_check that needs to be under rcu_read_lock is blk_throtl_bio, so move the locking there. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 209fdd8939fb..ac0083450500 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -2168,7 +2168,7 @@ bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg,
bool throttled = false;
struct throtl_data *td = tg->td;
- WARN_ON_ONCE(!rcu_read_lock_held());
+ rcu_read_lock();
/* see throtl_charge_bio() */
if (bio_flagged(bio, BIO_THROTTLED))
@@ -2273,6 +2273,7 @@ out:
if (throttled || !td->track_bio_latency)
bio->bi_issue.value |= BIO_ISSUE_THROTL_SKIP_LATENCY;
#endif
+ rcu_read_unlock();
return throttled;
}