From patchwork Thu May 19 14:43:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 96394 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 9FC77B718C for ; Fri, 20 May 2011 00:44:05 +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 1QN4SA-0005NO-Vb; Thu, 19 May 2011 14:43:55 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QN4S8-0005N6-Bx; Thu, 19 May 2011 14:43:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QN4S8-0005lB-6m; Thu, 19 May 2011 14:43:52 +0000 Received: from p5b2e551a.dip.t-dialin.net ([91.46.85.26] helo=[192.168.2.121]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QN4S8-0000n7-18; Thu, 19 May 2011 14:43:52 +0000 Message-ID: <4DD52CA7.9070100@canonical.com> Date: Thu, 19 May 2011 16:43:51 +0200 From: Stefan Bader User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ubuntu Kernel Team , ubuntu-server@lists.ubuntu.com Subject: [RFC] The future of iscsitarget X-Enigmail-Version: 1.1.2 Cc: Colin Watson 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 We currently carry iscsitarget as one of our ubuntu specific modules. Due to the compile breaking for Oneiric, I was looking into this. I found that, at least starting with Maverick, there is a source package iscsitarget which also produces a dkms module. The code of both is nearly identical, but have already diverged due to fixups done to the kernel side while the dkms version just stayed at the last upstream version. First question would be whether we really need iscsitarget at all as there is an in kernel scsi target framework[1]. The answer may be yes, because people (still) use it. But then it is not very efficient to provide the kernel module in the kernel itself and a dkms package. I would tend to say it should be removed from the kernel tree and only be provided by dkms as then all the code from the iscsitarget project is in one package, the module should not be important during installation as it only allows to use the host as a target and when fixing the dkms build in the iscsitarget package, the changes maybe flow back via debian to the original project (though it looked a bit like there has been no activity/changes since end of last year). What would be other peoples thoughts on this? -Stefan [1] http://lwn.net/Articles/424004/ From 5cf7286560ac39367f99319694dda889047208ca Mon Sep 17 00:00:00 2001 From: Stefan Bader Date: Tue, 17 May 2011 17:45:00 +0200 Subject: [PATCH] UBUNTU: iscsitarget: Convert to new plugging method The block device plugging used to be per-queue and implicitly done when requests where added to an empty queue. Now callers have to plug and unplug per-task. This fixes a FTBS with 2.6.39 kernel code. Signed-off-by: Stefan Bader --- debian.master/config/config.common.ubuntu | 2 +- ubuntu/iscsitarget/block-io.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu index cc4c4fe..12ddcdd 100644 --- a/debian.master/config/config.common.ubuntu +++ b/debian.master/config/config.common.ubuntu @@ -4096,7 +4096,7 @@ CONFIG_SCSI_IN2000=m CONFIG_SCSI_INIA100=m CONFIG_SCSI_INITIO=m CONFIG_SCSI_IPS=m -# CONFIG_SCSI_ISCSITARGET is not set +CONFIG_SCSI_ISCSITARGET=m CONFIG_SCSI_ISCSI_ATTRS=m # CONFIG_SCSI_IZIP_EPP16 is not set # CONFIG_SCSI_IZIP_SLOW_CTR is not set diff --git a/ubuntu/iscsitarget/block-io.c b/ubuntu/iscsitarget/block-io.c index 3e7de38..e3c9e19 100644 --- a/ubuntu/iscsitarget/block-io.c +++ b/ubuntu/iscsitarget/block-io.c @@ -56,6 +56,7 @@ blockio_make_request(struct iet_volume *volume, struct tio *tio, int rw) struct request_queue *bdev_q = bdev_get_queue(bio_data->bdev); struct tio_work *tio_work; struct bio *tio_bio = NULL, *bio = NULL, *biotail = NULL; + struct blk_plug plug; u32 offset = tio->offset; u32 size = tio->size; @@ -78,6 +79,8 @@ blockio_make_request(struct iet_volume *volume, struct tio *tio, int rw) atomic_set(&tio_work->bios_remaining, 0); init_completion(&tio_work->tio_complete); + blk_start_plug(&plug); + /* Main processing loop, allocate and fill all bios */ while (tio_index < tio->pg_cnt) { bio = bio_alloc(GFP_KERNEL, min(max_pages, BIO_MAX_PAGES)); @@ -127,8 +130,7 @@ blockio_make_request(struct iet_volume *volume, struct tio *tio, int rw) submit_bio(rw, bio); } - if (bdev_q && bdev_q->unplug_fn) - bdev_q->unplug_fn(bdev_q); + blk_finish_plug(&plug); wait_for_completion(&tio_work->tio_complete); -- 1.7.0.4