From patchwork Wed Feb 20 21:44:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 10826039 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 218FA1399 for ; Fri, 22 Feb 2019 13:52:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF7F32736 for ; Fri, 22 Feb 2019 13:52:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F36443273A; Fri, 22 Feb 2019 13:52:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8DC9D32736 for ; Fri, 22 Feb 2019 13:52:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 838C97DCD2; Fri, 22 Feb 2019 13:52:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 403881001E8B; Fri, 22 Feb 2019 13:52:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E03FB181A048; Fri, 22 Feb 2019 13:52:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1KLj1ml027104 for ; Wed, 20 Feb 2019 16:45:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0E5DC5D9E2; Wed, 20 Feb 2019 21:45:01 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2B9F5D9D3; Wed, 20 Feb 2019 21:44:55 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FC5B30A7C8D; Wed, 20 Feb 2019 21:44:54 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id z25so7381169qti.13; Wed, 20 Feb 2019 13:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=H6qPnPW1Z+wgwsBEK/HAKuRRGMjLB3OhxqHLNU5o3as=; b=mfDDEYRZgrHeFi50/n7BRTuyAGtFbMc+rwq985OgzqJVSOr5+2dYDGZUesdFkizb+U b0vHWeZusNcihNvNR8X6dFl9dtcCUgB0DQw+r0w48BG3pNx0zDetjj93q37FziC3xTPE ZCm9Gtq3kHczUyvFETUi96StNtz2K/dEiFfCinBYnpu/laER5i8zsQO8YcrsZ0KxxkQX 8P0WFzAm7/ocNqre0SL1FgvQF8fWVmM1KwUAGFG34jYqhwlDOMMrvQE3WufuU+H5T6YR KiFNxoRE/8yeNkF8MNuq7AEw+EwIQ1gYaWCKRFk8Fgg7gOJ47dDM4XX2j2BBwJ1zhKfy 4o6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=H6qPnPW1Z+wgwsBEK/HAKuRRGMjLB3OhxqHLNU5o3as=; b=NyX8gv7Zswd3Hey5cIGEbFIiD5OJHUwBwZ6qc9ZdMbiTe7nzTsRS8HJnHuloidovdL AtuYGz4rQWIiRuv5kAWL2ju6TnjJBYTdEmz9FaCNuUBBfcerTPM9JhUOkxKLB97No2QF XdacwPdb1dCOsFrtSCGIAngatpvoBLIC/ee3vuVzUNlt5tOYpnVAvx+4BMqdEqdhVN9U 4SXWQIhCk7ZYFZZ4WCgjZW7IQY4yXBJFYkcI5gTTRySiY++7Jg5gjG+qVsdxkwQQh7Y4 3VEXS2ekreWvV8TV7soHhGDjM457SPTrikF7Fi4NoyomvD8cxauVT5I81JIwAngRAg06 gPrg== X-Gm-Message-State: AHQUAuY11NgQv0MrMzcE417L8EGNa94p/sxyoDrFUMCHhJy6BjX1qQCP 5ZbU1SPcqWwK0euPMN2LTkuZ2g8e X-Google-Smtp-Source: AHgI3IYNVamaKEgQX3ONNj+XSBEYoo0A2Tqrh7iXDcxVIUgwLPMg65/miISvROE71v1XPNUq4UZV6A== X-Received: by 2002:a0c:9346:: with SMTP id e6mr26904739qve.98.1550699092963; Wed, 20 Feb 2019 13:44:52 -0800 (PST) Received: from localhost (pool-151-203-80-152.bstnma.fios.verizon.net. [151.203.80.152]) by smtp.gmail.com with ESMTPSA id l129sm9527624qkb.44.2019.02.20.13.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 13:44:52 -0800 (PST) From: Mike Snitzer To: dm-devel@redhat.com Date: Wed, 20 Feb 2019 16:44:35 -0500 Message-Id: <20190220214436.38476-9-snitzer@redhat.com> In-Reply-To: <20190220214436.38476-1-snitzer@redhat.com> References: <20190220214436.38476-1-snitzer@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 20 Feb 2019 21:44:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 20 Feb 2019 21:44:54 +0000 (UTC) for IP:'209.85.160.193' DOMAIN:'mail-qt1-f193.google.com' HELO:'mail-qt1-f193.google.com' FROM:'snitzer@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.211 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.160.193 mail-qt1-f193.google.com 209.85.160.193 mail-qt1-f193.google.com X-RedHat-Possible-Forgery: Mike Snitzer X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH v2 8/9] dm mpath: enable noclone support for bio-based X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 22 Feb 2019 13:52:27 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Avoiding bio cloning (aka noclone) offers a slight advantage over bio cloning for this read workload: fio --ioengine=psync --iodepth=1 --rw=read --bs=512 --direct=1 \ --numjobs=12 --time_based --runtime=10 --group_reporting --name=/dev/mapper/mpath clone 3331MB/s 3337MB/s 3355MB/s noclone 3418MB/s 3407MB/s 3420MB/s Signed-off-by: Mike Snitzer --- drivers/md/dm-mpath.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 2ee5e357a0a7..579330cd7a6a 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1178,9 +1178,10 @@ static int multipath_ctr(struct dm_target *ti, unsigned argc, char **argv) ti->num_discard_bios = 1; ti->num_write_same_bios = 1; ti->num_write_zeroes_bios = 1; - if (m->queue_mode == DM_TYPE_BIO_BASED) + if (m->queue_mode == DM_TYPE_BIO_BASED) { + ti->no_clone = true; ti->per_io_data_size = multipath_per_bio_data_size(); - else + } else ti->per_io_data_size = sizeof(struct dm_mpath_io); return 0; @@ -1584,11 +1585,11 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone, return r; } -static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, +static int multipath_end_io_bio(struct dm_target *ti, struct bio *bio, blk_status_t *error) { struct multipath *m = ti->private; - struct dm_mpath_io *mpio = get_mpio_from_bio(clone); + struct dm_mpath_io *mpio = get_mpio_from_bio(bio); struct pgpath *pgpath = mpio->pgpath; unsigned long flags; int r = DM_ENDIO_DONE; @@ -1611,7 +1612,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone, } spin_lock_irqsave(&m->lock, flags); - bio_list_add(&m->queued_bios, clone); + bio_list_add(&m->queued_bios, bio); spin_unlock_irqrestore(&m->lock, flags); if (!test_bit(MPATHF_QUEUE_IO, &m->flags)) queue_work(kmultipathd, &m->process_queued_bios); @@ -2011,7 +2012,7 @@ static int multipath_busy(struct dm_target *ti) *---------------------------------------------------------------*/ static struct target_type multipath_target = { .name = "multipath", - .version = {1, 13, 0}, + .version = {1, 14, 0}, .features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE | DM_TARGET_PASSES_INTEGRITY, .module = THIS_MODULE,