From patchwork Mon Jun 8 01:08:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Jianfeng X-Patchwork-Id: 28539 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n581AkgQ018068 for ; Mon, 8 Jun 2009 01:10:46 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 4F892619498; Sun, 7 Jun 2009 21:10:45 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n581AcAb012635 for ; Sun, 7 Jun 2009 21:10:38 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n581AYux021766; Sun, 7 Jun 2009 21:10:34 -0400 Received: from song.cn.fujitsu.com (cn.fujitsu.com [222.73.24.84] (may be forged)) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id n581AKeh018238; Sun, 7 Jun 2009 21:10:21 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 2A2F3170080; Mon, 8 Jun 2009 09:31:17 +0800 (CST) Received: from fnst.cn.fujitsu.com (localhost.localdomain [127.0.0.1]) by tang.cn.fujitsu.com (8.13.1/8.13.1) with ESMTP id n581LeKK028067; Mon, 8 Jun 2009 09:21:40 +0800 Received: from [127.0.0.1] (unknown [10.167.141.226]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 280B4D402F; Mon, 8 Jun 2009 09:09:58 +0800 (CST) Message-ID: <4A2C649C.8070806@cn.fujitsu.com> Date: Mon, 08 Jun 2009 09:08:44 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal References: <1243377729-2176-1-git-send-email-vgoyal@redhat.com> <1243377729-2176-3-git-send-email-vgoyal@redhat.com> In-Reply-To: <1243377729-2176-3-git-send-email-vgoyal@redhat.com> X-RedHat-Spam-Score: -0.71 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@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 X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 --- 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