From patchwork Fri Jun 26 08:13:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Jianfeng X-Patchwork-Id: 32527 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 n5Q8E8xC006058 for ; Fri, 26 Jun 2009 08:14:08 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 829D6619853; Fri, 26 Jun 2009 04:14:07 -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 n5Q8E5YK008538 for ; Fri, 26 Jun 2009 04:14:05 -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 n5Q8E1CY027029; Fri, 26 Jun 2009 04:14:01 -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 n5Q8Dk1I004847; Fri, 26 Jun 2009 04:13:47 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id C058D170080; Fri, 26 Jun 2009 16:15:59 +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 n5Q8bJUQ016043; Fri, 26 Jun 2009 16:37:19 +0800 Received: from [127.0.0.1] (unknown [10.167.141.226]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 3E361D4036; Fri, 26 Jun 2009 16:15:38 +0800 (CST) Message-ID: <4A44832B.1020108@cn.fujitsu.com> Date: Fri, 26 Jun 2009 16:13:31 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal References: <1245443858-8487-1-git-send-email-vgoyal@redhat.com> <1245443858-8487-21-git-send-email-vgoyal@redhat.com> <4A3F3648.7080007@cn.fujitsu.com> <20090622172123.GE15600@redhat.com> <4A4079B8.4020402@cn.fujitsu.com> <20090623140250.GA4262@redhat.com> <4A41EFE1.5050101@cn.fujitsu.com> In-Reply-To: <4A41EFE1.5050101@cn.fujitsu.com> X-RedHat-Spam-Score: -0.739 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] [PATCH 1/2] io-controller: Prepare a rt ioq list in efqd to keep track of busy rt ioqs 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 Maintain a busy rt ioq list in efqd so that we can easily keep track of all busy rt ioqs in system. Signed-off-by: Gui Jianfeng --- block/elevator-fq.c | 8 ++++++++ block/elevator-fq.h | 6 ++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/block/elevator-fq.c b/block/elevator-fq.c index d779282..1d4ec1f 100644 --- a/block/elevator-fq.c +++ b/block/elevator-fq.c @@ -3247,6 +3247,10 @@ void elv_add_ioq_busy(struct elv_fq_data *efqd, struct io_queue *ioq) if (elv_ioq_class_rt(ioq)) { struct io_group *iog = ioq_to_io_group(ioq); iog->busy_rt_queues++; + + /* queue lock has been already held by caller */ + hlist_add_head_rcu(&ioq->rt_node, + &ioq->efqd->rt_ioq_list); } #ifdef CONFIG_DEBUG_GROUP_IOSCHED @@ -3293,6 +3297,9 @@ void elv_del_ioq_busy(struct elevator_queue *e, struct io_queue *ioq, if (elv_ioq_class_rt(ioq)) { struct io_group *iog = ioq_to_io_group(ioq); iog->busy_rt_queues--; + + /* queue lock has been already held by caller */ + hlist_del_rcu(&ioq->rt_node); } elv_deactivate_ioq(efqd, ioq, requeue); @@ -4196,6 +4203,7 @@ int elv_init_fq_data(struct request_queue *q, struct elevator_queue *e) INIT_WORK(&efqd->unplug_work, elv_kick_queue); INIT_HLIST_HEAD(&efqd->group_list); + INIT_HLIST_HEAD(&efqd->rt_ioq_list); efqd->elv_slice[0] = elv_slice_async; efqd->elv_slice[1] = elv_slice_sync; diff --git a/block/elevator-fq.h b/block/elevator-fq.h index b3193f8..53a64b6 100644 --- a/block/elevator-fq.h +++ b/block/elevator-fq.h @@ -169,6 +169,9 @@ struct io_queue { atomic_t ref; unsigned int flags; + /* node to insert into efqd->rt_ioq_list */ + struct hlist_node rt_node; + /* Pointer to generic elevator data structure */ struct elv_fq_data *efqd; pid_t pid; @@ -336,6 +339,9 @@ struct elv_fq_data { /* List of io groups hanging on this elevator */ struct hlist_head group_list; + /* List of rt ioqs in hierarchy*/ + struct hlist_head rt_ioq_list; + struct request_queue *queue; unsigned int busy_queues;