From patchwork Tue Dec 27 15:56:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9493253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DA9562AB4 for ; Mon, 2 Jan 2017 09:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B6AB205AB for ; Mon, 2 Jan 2017 09:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EF38267EC; Mon, 2 Jan 2017 09:33:53 +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=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (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 1F9DA205AB for ; Mon, 2 Jan 2017 09:33:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v029WZV9041826; Mon, 2 Jan 2017 04:32:35 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uBRFxjpm011149 for ; Tue, 27 Dec 2016 10:59:45 -0500 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBRFxj1d029195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 Dec 2016 10:59:45 -0500 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) (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 8486A6A6B3; Tue, 27 Dec 2016 15:59:44 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id i88so18311115pfk.2; Tue, 27 Dec 2016 07:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pOTiXqHjWJ5ru0yHAk6Sg4Y2TB9MY7gEIblDvkcn9Ew=; b=Aipt7p0ilTlRcoQbsI5l/jlb3gZcPdPcWJrSF+maGFhsyk73oFKSjb7Fmq9h5JqJ8d bwmtL342aIme3FbRdvdAuXeSupzOVaj+wdypEc4IOx0g023WThkzzfZP+T+w4W3U/LV3 10aYbJZoOnExemPDZ6PKS6DbrMH+KDziLW1mo1A8SIXNq2w2OuV5flGJsaTpsSCPUIxS n/1jtwo05dVh2CofHs0MP1yOadGKQdWnKBIrQCq5bt60WkMJkwfwCOxGgTuR4clGS1jR YzNiXUWsycPsDEsd/a+7Cgs9uixPMqv7ee3mqI0Ld8HnRyDh2jv38J5uwTo6inYnSVF3 vA/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pOTiXqHjWJ5ru0yHAk6Sg4Y2TB9MY7gEIblDvkcn9Ew=; b=VaHa+fn41+EIsUyUNZPONzBHbZDziCI+iU9FDvwPHDdW6gRO1juy73AW2tpewN3tKj XF0UCbFlBSPasttQsGsSnHY5zzju05Yw7qpM0GwLjONnPZwB4alpccfMetUfKE+YVHbg Pqt7q1c3MJhOenix99hUbPXl1Lh2iR1jK3M9deXPzJ9P0Uq9VikKhr9QO0YJfVHbevGT D1Upl81jITMfEdPiOf7NSGvAyXpC/OQwyr2p16NW9pt+m1DL1fIKMDg1fYESEljxla58 g7jXkvGnsjYmaIYvMKCw5yPy+uCIL6lBeOJl8dM4UsYSC4kBPfjuXU+Ph5xySfHaJ2VW QzAw== X-Gm-Message-State: AIkVDXIaNONfkLWL29Yzdq0BDhZUVLbe+Ddw27Xn4hWfue2PqGXS6CuJiwaoGd6EwaW5/g== X-Received: by 10.98.252.75 with SMTP id e72mr30196229pfh.6.1482854383713; Tue, 27 Dec 2016 07:59:43 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id p127sm89081776pfg.24.2016.12.27.07.59.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 07:59:42 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Date: Tue, 27 Dec 2016 23:56:01 +0800 Message-Id: <1482854250-13481-13-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1482854250-13481-1-git-send-email-tom.leiming@gmail.com> References: <1482854250-13481-1-git-send-email-tom.leiming@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Dec 2016 15:59:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 27 Dec 2016 15:59:44 +0000 (UTC) for IP:'209.85.192.196' DOMAIN:'mail-pf0-f196.google.com' HELO:'mail-pf0-f196.google.com' FROM:'tom.leiming@gmail.com' RCPT:'' X-RedHat-Spam-Score: -1.157 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.192.196 mail-pf0-f196.google.com 209.85.192.196 mail-pf0-f196.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 02 Jan 2017 04:31:56 -0500 Cc: Christoph Hellwig , Mike Snitzer , Ming Lei , linux-block@vger.kernel.org, "maintainer:DEVICE-MAPPER LVM, Shaohua Li , linux-raid@vger.kernel.org open list:SOFTWARE RAID Multiple DisksSUPPORT" , Alasdair Kergon Subject: [dm-devel] [PATCH v1 12/54] dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE 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-Virus-Scanned: ClamAV using ClamSMTP For BIO based DM, some targets aren't ready for dealing with bigger incoming bio than 1Mbyte, such as crypt target. Signed-off-by: Ming Lei --- drivers/md/dm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 3086da5664f3..6139bf7623f7 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -899,7 +899,16 @@ int dm_set_target_max_io_len(struct dm_target *ti, sector_t len) return -EINVAL; } - ti->max_io_len = (uint32_t) len; + /* + * BIO based queue uses its own splitting. When multipage bvecs + * is switched on, size of the incoming bio may be too big to + * be handled in some targets, such as crypt. + * + * When these targets are ready for the big bio, we can remove + * the limit. + */ + ti->max_io_len = min_t(uint32_t, len, + (BIO_MAX_PAGES * PAGE_SIZE)); return 0; }