From patchwork Thu May 26 14:42:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 97584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8944CB6F90 for ; Fri, 27 May 2011 00:42:30 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QPblP-00012t-4H; Thu, 26 May 2011 14:42:15 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QPblN-00012m-3l for kernel-team@lists.ubuntu.com; Thu, 26 May 2011 14:42:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QPblL-000801-MP for ; Thu, 26 May 2011 14:42:11 +0000 Received: from p5b2e5348.dip.t-dialin.net ([91.46.83.72] helo=[192.168.2.5]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QPblL-0007N9-Fn for kernel-team@lists.ubuntu.com; Thu, 26 May 2011 14:42:11 +0000 Message-ID: <4DDE66BF.3010104@canonical.com> Date: Thu, 26 May 2011 16:42:07 +0200 From: Stefan Bader User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ubuntu Kernel Team Subject: [Oneiric] Convert dm-raid45 to new block device plugging X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com I was discussing this with the maintainer. According to him the dm-raid45 code is not developed further. The goal would be to convert the dmraid user-space side to use dm-raid (which is a target for RAID4/5/6 that uses md). However looking at any user-space code that was available to the public right now, I do not see any support for this. The table format, which is used to create the device-mapper targets is substantially different between the two modules. So user-space would have to change accordingly (and I am not sure how well all features would be supported at the moment). So, at least for Oneiric, I think we need to stay with the dm-raid45. I tested the change below on an Intel soft-RAID5 and it survived an iozone and a bonnie++ run. -Stefan From 3f1298b21f4aa5d21a8a22a69f6d602fd091789e Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Thu, 26 May 2011 13:19:57 +0200 Subject: [PATCH] UBUNTU: SAUCE: Convert dm-raid45 to new block plugging Plugging for IOs to block devices was changed to an explicit, per task base. This converts the module to the new framework, fixing the compile failure. Signed-off-by: Stefan Bader --- debian.master/config/config.common.ubuntu | 2 +- ubuntu/dm-raid4-5/dm-raid4-5.c | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu index 44cb9ee..fc9081f 100644 --- a/debian.master/config/config.common.ubuntu +++ b/debian.master/config/config.common.ubuntu @@ -1185,7 +1185,7 @@ CONFIG_DM_CRYPT=m CONFIG_DM_MULTIPATH_QL=m CONFIG_DM_MULTIPATH_ST=m CONFIG_DM_RAID=m -# CONFIG_DM_RAID45 is not set +CONFIG_DM_RAID45=m CONFIG_DM_UEVENT=y CONFIG_DM_ZERO=m CONFIG_DNET=m diff --git a/ubuntu/dm-raid4-5/dm-raid4-5.c b/ubuntu/dm-raid4-5/dm-raid4-5.c index 504aee3..fcc782c 100644 --- a/ubuntu/dm-raid4-5/dm-raid4-5.c +++ b/ubuntu/dm-raid4-5/dm-raid4-5.c @@ -3275,18 +3275,6 @@ static void do_ios(struct raid_set *rs, struct bio_list *ios) bio_list_merge_head(ios, &reject); } -/* Unplug: let any queued io role on the sets devices. */ -static void do_unplug(struct raid_set *rs) -{ - struct raid_dev *dev = rs->dev + rs->set.raid_devs; - - while (dev-- > rs->dev) { - /* Only call any device unplug function, if io got queued. */ - if (TestClearDevIoQueued(dev)) - blk_unplug(bdev_get_queue(dev->dev->bdev)); - } -} - /* Send an event in case we're getting too busy. */ static void do_busy_event(struct raid_set *rs) { @@ -3326,6 +3314,7 @@ static void do_raid(struct work_struct *ws) struct raid_set *rs = container_of(ws, struct raid_set, io.dws_do_raid.work); struct bio_list *ios = &rs->io.work, *ios_in = &rs->io.in; + struct blk_plug plug; /* * We always need to end io, so that ios can get errored in @@ -3342,8 +3331,9 @@ static void do_raid(struct work_struct *ws) do_sc_resize(rs); /* Try to recover regions. */ + blk_start_plug(&plug); do_recovery(rs); - do_unplug(rs); /* Unplug the sets device queues. */ + blk_finish_plug(&plug); /* Unplug the queue */ /* Quickly grab all new ios queued and add them to the work list. */ mutex_lock(&rs->io.in_lock); @@ -3351,11 +3341,12 @@ static void do_raid(struct work_struct *ws) bio_list_init(ios_in); mutex_unlock(&rs->io.in_lock); + blk_start_plug(&plug); if (!bio_list_empty(ios)) do_ios(rs, ios); /* Got ios to work into the cache. */ do_flush(rs); /* Flush any stripes on io list. */ - do_unplug(rs); /* Unplug the sets device queues. */ + blk_finish_plug(&plug); /* Unplug the queue */ do_busy_event(rs); /* Check if we got too busy. */ } -- 1.7.4.1