diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:15:29 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:24 -0500 |
commit | 671058fb2a2aac4e70f01b316b06bc59b98bd138 (patch) | |
tree | 6c49961409ad0e3c16b5e2027f515cafecedf39a | |
parent | 4f85cb96d9d2fbbb7160db855a6beee1baced5e5 (diff) |
block: make blk-throttle preserve the issuing task on delayed bios
Make blk-throttle call bio_associate_current() on bios being delayed
such that they get issued to block layer with the original io_context.
This allows stacking blk-throttle and cfq-iosched propio policies.
bios will always be issued with the correct ioc and blkcg whether it
gets delayed by blk-throttle or not.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-throttle.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 08b7ab292a80..4ba141820a2e 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -894,6 +894,9 @@ bool blk_throtl_bio(struct request_queue *q, struct bio *bio) | |||
894 | goto out; | 894 | goto out; |
895 | } | 895 | } |
896 | 896 | ||
897 | /* bio_associate_current() needs ioc, try creating */ | ||
898 | create_io_context(GFP_ATOMIC, q->node); | ||
899 | |||
897 | /* | 900 | /* |
898 | * A throtl_grp pointer retrieved under rcu can be used to access | 901 | * A throtl_grp pointer retrieved under rcu can be used to access |
899 | * basic fields like stats and io rates. If a group has no rules, | 902 | * basic fields like stats and io rates. If a group has no rules, |
@@ -958,6 +961,7 @@ queue_bio: | |||
958 | tg->io_disp[rw], tg->iops[rw], | 961 | tg->io_disp[rw], tg->iops[rw], |
959 | tg->nr_queued[READ], tg->nr_queued[WRITE]); | 962 | tg->nr_queued[READ], tg->nr_queued[WRITE]); |
960 | 963 | ||
964 | bio_associate_current(bio); | ||
961 | throtl_add_bio_tg(q->td, tg, bio); | 965 | throtl_add_bio_tg(q->td, tg, bio); |
962 | throttled = true; | 966 | throttled = true; |
963 | 967 | ||