From patchwork Sat Aug 8 08:14:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Jianfeng X-Patchwork-Id: 40112 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 n78AClNE008571 for ; Sat, 8 Aug 2009 10:12:47 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 0410D61ABC4; Sat, 8 Aug 2009 06:12: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 n78ACfhV031576 for ; Sat, 8 Aug 2009 06:12:41 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n78ACbWS028104; Sat, 8 Aug 2009 06:12:37 -0400 Received: from song.cn.fujitsu.com ([222.73.24.84]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n78ACJfE014234; Sat, 8 Aug 2009 06:12:20 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 2BECD170028; Sat, 8 Aug 2009 16:16:33 +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 n788JISI024634; Sat, 8 Aug 2009 16:19:19 +0800 Received: from [127.0.0.1] (unknown [10.167.141.226]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 53B79D40F0; Sat, 8 Aug 2009 16:19:17 +0800 (CST) Message-ID: <4A7D33FB.6090207@cn.fujitsu.com> Date: Sat, 08 Aug 2009 16:14:51 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal References: <1248467274-32073-1-git-send-email-vgoyal@redhat.com> <1248467274-32073-23-git-send-email-vgoyal@redhat.com> In-Reply-To: <1248467274-32073-23-git-send-email-vgoyal@redhat.com> X-RedHat-NoPTR: 222.73.24.84 has sent a message and has no valid PTR record X-RedHat-Spam-Score: -0.988 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.31 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, 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 22/24] io-controller: Per io group bdi congestion interface 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: ... > +/* Set io group congestion on and off thresholds */ > +void elv_io_group_congestion_threshold(struct request_queue *q, > + struct io_group *iog) > +{ > + int nr; > + > + nr = q->nr_group_requests - (q->nr_group_requests / 8) + 1; > + if (nr > q->nr_group_requests) > + nr = q->nr_group_requests; > + iog->nr_congestion_on = nr; > + > + nr = q->nr_group_requests - (q->nr_group_requests / 8) > + - (q->nr_group_requests / 16) - 1; > + if (nr < 1) > + nr = 1; > + iog->nr_congestion_off = nr; Vivek, Since we determine whether io group is congenssed or not just by checking iog->nr_congestion_on, we can get rid of iog->nr_congestion_off here. Signed-off-by: Gui Jianfeng --- block/elevator-fq.c | 6 ------ block/elevator-fq.h | 3 +-- 2 files changed, 1 insertions(+), 8 deletions(-) diff --git a/block/elevator-fq.c b/block/elevator-fq.c index 66b10eb..e73da31 100644 --- a/block/elevator-fq.c +++ b/block/elevator-fq.c @@ -1267,12 +1267,6 @@ void elv_io_group_congestion_threshold(struct request_queue *q, if (nr > q->nr_group_requests) nr = q->nr_group_requests; iog->nr_congestion_on = nr; - - nr = q->nr_group_requests - (q->nr_group_requests / 8) - - (q->nr_group_requests / 16) - 1; - if (nr < 1) - nr = 1; - iog->nr_congestion_off = nr; } static inline int elv_is_iog_congested(struct request_queue *q, diff --git a/block/elevator-fq.h b/block/elevator-fq.h index 0581e55..2815279 100644 --- a/block/elevator-fq.h +++ b/block/elevator-fq.h @@ -266,9 +266,8 @@ struct io_group { /* Single ioq per group, used for noop, deadline, anticipatory */ struct io_queue *ioq; - /* io group congestion on and off threshold for request descriptors */ + /* io group congestion on threshold for request descriptors */ unsigned int nr_congestion_on; - unsigned int nr_congestion_off; /* request list associated with the group */ struct request_list rl;