[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] Re: [PATCH 02/20] io-controller: Common flat fair queuing code in elevaotor layer
- From: Gui Jianfeng <guijianfeng cn fujitsu com>
- To: Vivek Goyal <vgoyal redhat com>
- Cc: dhaval linux vnet ibm com, snitzer redhat com, peterz infradead org, dm-devel redhat com, dpshah google com, jens axboe oracle com, agk redhat com, balbir linux vnet ibm com, paolo valente unimore it, fernando oss ntt co jp, mikew google com, jmoyer redhat com, nauman google com, m-ikeda ds jp nec com, lizf cn fujitsu com, fchecconi gmail com, akpm linux-foundation org, jbaron redhat com, linux-kernel vger kernel org, s-uchida ap jp nec com, righi andrea gmail com, containers lists linux-foundation org
- Subject: [dm-devel] Re: [PATCH 02/20] io-controller: Common flat fair queuing code in elevaotor layer
- Date: Mon, 08 Jun 2009 09:08:44 +0800
Vivek Goyal wrote:
...
> +
> +/* Get next queue for service. */
> +struct io_queue *elv_get_next_ioq(struct request_queue *q, int extract)
> +{
> + struct elv_fq_data *efqd = &q->elevator->efqd;
> + struct io_entity *entity = NULL;
> + struct io_queue *ioq = NULL;
> + struct io_sched_data *sd;
> +
> + /*
> + * one can check for which queue will be selected next while having
> + * one queue active. preempt logic uses it.
> + */
> + BUG_ON(extract && efqd->active_queue != NULL);
> +
> + if (!efqd->busy_queues)
> + return NULL;
> +
> + sd = &efqd->root_group->sched_data;
> + if (extract)
> + entity = bfq_lookup_next_entity(sd, 1);
> + else
> + entity = bfq_lookup_next_entity(sd, 0);
This if and else branch is not needed.
Signed-off-by: Gui Jianfeng <guijianfeng cn fujitsu com>
---
block/elevator-fq.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/block/elevator-fq.c b/block/elevator-fq.c
index 3c5f9da..655162b 100644
--- a/block/elevator-fq.c
+++ b/block/elevator-fq.c
@@ -3069,10 +3069,7 @@ struct io_queue *elv_get_next_ioq(struct request_queue *q, int extract)
sd = &efqd->root_group->sched_data;
for (; sd != NULL; sd = entity->my_sched_data) {
- if (extract)
- entity = bfq_lookup_next_entity(sd, 1);
- else
- entity = bfq_lookup_next_entity(sd, 0);
+ entity = bfq_lookup_next_entity(sd, extract);
/*
* entity can be null despite the fact that there are busy
--
1.5.4.rc3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]