diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-09 14:45:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-09 14:45:21 -0500 |
commit | aceb91cd351bc3a19a783c901fe8a8070d5f6fa9 (patch) | |
tree | a0863e940a77ae10d3c8b391488e29a8245b31be /block | |
parent | ae8eed2d0906bf0d8eb0c2a4651676a41d361297 (diff) | |
parent | b8cf0e0e552ca48e9a00f518aeb4f5e03984022b (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cdrom: support devices that have check_events but not media_changed
cfq-iosched: Don't wait if queue already has requests.
blkio-throttle: Avoid calling blkiocg_lookup_group() for root group
cfq: rename a function to give it more appropriate name
cciss: make cciss_revalidate not loop through CISS_MAX_LUNS volumes unnecessarily.
drivers/block/aoe/Makefile: replace the use of <module>-objs with <module>-y
loop: queue_lock NULL pointer derefence in blk_throtl_exit
drivers/block/Makefile: replace the use of <module>-objs with <module>-y
blktrace: Don't output messages if NOTIFY isn't set.
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-throttle.c | 10 | ||||
-rw-r--r-- | block/cfq-iosched.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 381b09bb562b..a89043a3caa4 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -168,7 +168,15 @@ static struct throtl_grp * throtl_find_alloc_tg(struct throtl_data *td, | |||
168 | * tree of blkg (instead of traversing through hash list all | 168 | * tree of blkg (instead of traversing through hash list all |
169 | * the time. | 169 | * the time. |
170 | */ | 170 | */ |
171 | tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key)); | 171 | |
172 | /* | ||
173 | * This is the common case when there are no blkio cgroups. | ||
174 | * Avoid lookup in this case | ||
175 | */ | ||
176 | if (blkcg == &blkio_root_cgroup) | ||
177 | tg = &td->root_tg; | ||
178 | else | ||
179 | tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key)); | ||
172 | 180 | ||
173 | /* Fill in device details for root group */ | 181 | /* Fill in device details for root group */ |
174 | if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) { | 182 | if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) { |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 501ffdf0399c..7be4c7959625 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -599,7 +599,7 @@ cfq_group_slice(struct cfq_data *cfqd, struct cfq_group *cfqg) | |||
599 | } | 599 | } |
600 | 600 | ||
601 | static inline unsigned | 601 | static inline unsigned |
602 | cfq_scaled_group_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 602 | cfq_scaled_cfqq_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
603 | { | 603 | { |
604 | unsigned slice = cfq_prio_to_slice(cfqd, cfqq); | 604 | unsigned slice = cfq_prio_to_slice(cfqd, cfqq); |
605 | if (cfqd->cfq_latency) { | 605 | if (cfqd->cfq_latency) { |
@@ -631,7 +631,7 @@ cfq_scaled_group_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
631 | static inline void | 631 | static inline void |
632 | cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 632 | cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
633 | { | 633 | { |
634 | unsigned slice = cfq_scaled_group_slice(cfqd, cfqq); | 634 | unsigned slice = cfq_scaled_cfqq_slice(cfqd, cfqq); |
635 | 635 | ||
636 | cfqq->slice_start = jiffies; | 636 | cfqq->slice_start = jiffies; |
637 | cfqq->slice_end = jiffies + slice; | 637 | cfqq->slice_end = jiffies + slice; |
@@ -1671,7 +1671,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
1671 | */ | 1671 | */ |
1672 | if (timed_out) { | 1672 | if (timed_out) { |
1673 | if (cfq_cfqq_slice_new(cfqq)) | 1673 | if (cfq_cfqq_slice_new(cfqq)) |
1674 | cfqq->slice_resid = cfq_scaled_group_slice(cfqd, cfqq); | 1674 | cfqq->slice_resid = cfq_scaled_cfqq_slice(cfqd, cfqq); |
1675 | else | 1675 | else |
1676 | cfqq->slice_resid = cfqq->slice_end - jiffies; | 1676 | cfqq->slice_resid = cfqq->slice_end - jiffies; |
1677 | cfq_log_cfqq(cfqd, cfqq, "resid=%ld", cfqq->slice_resid); | 1677 | cfq_log_cfqq(cfqd, cfqq, "resid=%ld", cfqq->slice_resid); |
@@ -3432,6 +3432,10 @@ static bool cfq_should_wait_busy(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
3432 | { | 3432 | { |
3433 | struct cfq_io_context *cic = cfqd->active_cic; | 3433 | struct cfq_io_context *cic = cfqd->active_cic; |
3434 | 3434 | ||
3435 | /* If the queue already has requests, don't wait */ | ||
3436 | if (!RB_EMPTY_ROOT(&cfqq->sort_list)) | ||
3437 | return false; | ||
3438 | |||
3435 | /* If there are other queues in the group, don't wait */ | 3439 | /* If there are other queues in the group, don't wait */ |
3436 | if (cfqq->cfqg->nr_cfqq > 1) | 3440 | if (cfqq->cfqg->nr_cfqq > 1) |
3437 | return false; | 3441 | return false; |