* [PATCH] cfq-iosched: don't check cfqg in choose_service_tree()
@ 2010-12-14 6:32 Gui Jianfeng
2010-12-14 16:56 ` Jeff Moyer
2010-12-14 22:25 ` Vivek Goyal
0 siblings, 2 replies; 3+ messages in thread
From: Gui Jianfeng @ 2010-12-14 6:32 UTC (permalink / raw)
To: Jens Axboe, Vivek Goyal; +Cc: linux kernel mailing list
When cfq_choose_cfqg() is called in select_queue(), there must be at least one
backlogged CFQ queue waiting for dispatching, hence there must be at least one
backlogged CFQ group on service tree. So we never call choose_service_tree()
with cfqg == NULL.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
block/cfq-iosched.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 9b186fd..c19d015 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2103,12 +2103,6 @@ static void choose_service_tree(struct cfq_data *cfqd, struct cfq_group *cfqg)
unsigned group_slice;
enum wl_prio_t original_prio = cfqd->serving_prio;
- if (!cfqg) {
- cfqd->serving_prio = IDLE_WORKLOAD;
- cfqd->workload_expires = jiffies + 1;
- return;
- }
-
/* Choose next priority. RT > BE > IDLE */
if (cfq_group_busy_queues_wl(RT_WORKLOAD, cfqd, cfqg))
cfqd->serving_prio = RT_WORKLOAD;
--
1.6.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cfq-iosched: don't check cfqg in choose_service_tree()
2010-12-14 6:32 [PATCH] cfq-iosched: don't check cfqg in choose_service_tree() Gui Jianfeng
@ 2010-12-14 16:56 ` Jeff Moyer
2010-12-14 22:25 ` Vivek Goyal
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Moyer @ 2010-12-14 16:56 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: Jens Axboe, Vivek Goyal, linux kernel mailing list
Gui Jianfeng <guijianfeng@cn.fujitsu.com> writes:
> When cfq_choose_cfqg() is called in select_queue(), there must be at least one
> backlogged CFQ queue waiting for dispatching, hence there must be at least one
> backlogged CFQ group on service tree. So we never call choose_service_tree()
> with cfqg == NULL.
Further, if cfqg was NULL, cfq_choose_cfqg would have dereferenced a
NULL pointer and we wouldn't even get to choose_service_tree.
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cfq-iosched: don't check cfqg in choose_service_tree()
2010-12-14 6:32 [PATCH] cfq-iosched: don't check cfqg in choose_service_tree() Gui Jianfeng
2010-12-14 16:56 ` Jeff Moyer
@ 2010-12-14 22:25 ` Vivek Goyal
1 sibling, 0 replies; 3+ messages in thread
From: Vivek Goyal @ 2010-12-14 22:25 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: Jens Axboe, linux kernel mailing list
On Tue, Dec 14, 2010 at 02:32:28PM +0800, Gui Jianfeng wrote:
> When cfq_choose_cfqg() is called in select_queue(), there must be at least one
> backlogged CFQ queue waiting for dispatching, hence there must be at least one
> backlogged CFQ group on service tree. So we never call choose_service_tree()
> with cfqg == NULL.
>
> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> ---
Thanks Gui for the cleanup. This patch looks good to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Vivek
> block/cfq-iosched.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 9b186fd..c19d015 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -2103,12 +2103,6 @@ static void choose_service_tree(struct cfq_data *cfqd, struct cfq_group *cfqg)
> unsigned group_slice;
> enum wl_prio_t original_prio = cfqd->serving_prio;
>
> - if (!cfqg) {
> - cfqd->serving_prio = IDLE_WORKLOAD;
> - cfqd->workload_expires = jiffies + 1;
> - return;
> - }
> -
> /* Choose next priority. RT > BE > IDLE */
> if (cfq_group_busy_queues_wl(RT_WORKLOAD, cfqd, cfqg))
> cfqd->serving_prio = RT_WORKLOAD;
> --
> 1.6.5.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-14 22:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14 6:32 [PATCH] cfq-iosched: don't check cfqg in choose_service_tree() Gui Jianfeng
2010-12-14 16:56 ` Jeff Moyer
2010-12-14 22:25 ` Vivek Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox