diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2011-05-19 15:38:23 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-05-20 14:34:52 -0400 |
commit | f469a7b4d5b1d1d053200a9015fd25d59c057f49 (patch) | |
tree | 2c68c0689e40955b186e350b15d44d0b260f4655 /block/blk-core.c | |
parent | 56edf7d75db5b14d628b46623c414ffbeed68d7f (diff) |
blk-cgroup: Allow sleeping while dynamically allocating a group
Currently, all the cfq_group or throtl_group allocations happen while
we are holding ->queue_lock and sleeping is not allowed.
Soon, we will move to per cpu stats and also need to allocate the
per group stats. As one can not call alloc_percpu() from atomic
context as it can sleep, we need to drop ->queue_lock, allocate the
group, retake the lock and continue processing.
In throttling code, I check the queue DEAD flag again to make sure
that driver did not call blk_cleanup_queue() in the mean time.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 3fe00a14822..9e8e297374b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1550,7 +1550,8 @@ static inline void __generic_make_request(struct bio *bio) | |||
1550 | goto end_io; | 1550 | goto end_io; |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | blk_throtl_bio(q, &bio); | 1553 | if (blk_throtl_bio(q, &bio)) |
1554 | goto end_io; | ||
1554 | 1555 | ||
1555 | /* | 1556 | /* |
1556 | * If bio = NULL, bio has been throttled and will be submitted | 1557 | * If bio = NULL, bio has been throttled and will be submitted |