From patchwork Thu Aug 27 02:49:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gui Jianfeng X-Patchwork-Id: 44189 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 n7R2p9Bb023113 for ; Thu, 27 Aug 2009 02:51:09 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 01D726193A1; Wed, 26 Aug 2009 22:51:07 -0400 (EDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n7R2p2AV019322 for ; Wed, 26 Aug 2009 22:51:02 -0400 Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.9]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7R2p1KG005495; Wed, 26 Aug 2009 22:51:01 -0400 Received: from song.cn.fujitsu.com (cn.fujitsu.com [222.73.24.84] (may be forged)) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7R2oomI003404; Wed, 26 Aug 2009 22:50:51 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 781F917012D; Thu, 27 Aug 2009 10:50:50 +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 n7R3Kk1s002094; Thu, 27 Aug 2009 11:20:47 +0800 Received: from [127.0.0.1] (unknown [10.167.141.226]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 9F40FD4116; Thu, 27 Aug 2009 10:55:47 +0800 (CST) Message-ID: <4A95F444.9040705@cn.fujitsu.com> Date: Thu, 27 Aug 2009 10:49:40 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal References: <1250451046-9966-1-git-send-email-vgoyal@redhat.com> <1250451046-9966-3-git-send-email-vgoyal@redhat.com> In-Reply-To: <1250451046-9966-3-git-send-email-vgoyal@redhat.com> X-RedHat-Spam-Score: 0.1 (RDNS_NONE) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.9 X-loop: dm-devel@redhat.com Cc: dhaval@linux.vnet.ibm.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, jmarchan@redhat.com, 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, s-uchida@ap.jp.nec.com, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, righi.andrea@gmail.com Subject: [dm-devel] Re: [PATCH 02/24] io-controller: Core of the elevator fair queuing 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: ... > +static void update_min_vdisktime(struct io_service_tree *st) > +{ > + u64 vdisktime; > + > + if (st->active_entity) > + vdisktime = st->active_entity->vdisktime; > + > + if (st->rb_leftmost) { > + struct io_entity *entity = rb_entry(st->rb_leftmost, > + struct io_entity, rb_node); > + > + if (!st->active_entity) > + vdisktime = entity->vdisktime; > + else > + vdisktime = min_vdisktime(vdisktime, entity->vdisktime); > + } > + > + st->min_vdisktime = max_vdisktime(st->min_vdisktime, vdisktime); > +} block/elevator-fq.c: In function ‘elv_ioq_slice_expired’: block/elevator-fq.c:132: warning: ‘vdisktime’ may be used uninitialized in this function LD block/built-in.o We'd better initialize vdisktime at first. Signed-off-by: Gui Jianfeng --- block/elevator-fq.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block/elevator-fq.c b/block/elevator-fq.c index d04e925..a4161c2 100644 --- a/block/elevator-fq.c +++ b/block/elevator-fq.c @@ -131,6 +131,8 @@ static void update_min_vdisktime(struct io_service_tree *st) { u64 vdisktime; + vdisktime = st->min_vdisktime; + if (st->active_entity) vdisktime = st->active_entity->vdisktime;