Messages in this thread | | | Date | Tue, 14 Dec 2010 14:09:33 +0800 | From | Gui Jianfeng <> | Subject | Re: [PATCH 5/8 v2] cfq-iosched: Introduce hierarchical scheduling with CFQ queue and group at the same level |
| |
Vivek Goyal wrote: ... >> -static struct cfq_group *cfq_get_next_cfqg(struct cfq_data *cfqd) >> +static void choose_service_tree(struct cfq_data *cfqd, struct cfq_group *cfqg) >> { >> - struct cfq_rb_root *st = &cfqd->grp_service_tree; >> - struct cfq_group *cfqg; >> - struct cfq_entity *cfqe; >> + struct cfq_rb_root *st; >> + unsigned count; >> >> - if (RB_EMPTY_ROOT(&st->rb)) >> - return NULL; >> - cfqe = cfq_rb_first_entity(st); >> - cfqg = cfqg_of_entity(cfqe); >> - BUG_ON(!cfqg); >> - update_min_vdisktime(st); >> - return cfqg; >> + if (!cfqg) { >> + cfqd->serving_prio = IDLE_WORKLOAD; >> + cfqd->workload_expires = jiffies + 1; >> + return; >> + } > > I am wondering where do we use above code. Do we ever call > choose_service_tree() with cfqg == NULL? Can't seem to figure out by > looking at the code. >
Vivek,
This piece of code comes from original CFQ code. Think more about it, this piece of code seems redundant. 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. I'd like to post a seperate patch to get rid of this piece.
Thanks, Gui
| |