From patchwork Sat Oct 29 08:08:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9405171 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.web.codeaurora.org (Postfix) with ESMTP id 0FD2D6022E for ; Mon, 31 Oct 2016 09:01:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBE522928D for ; Mon, 31 Oct 2016 09:01:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF7EA2928F; Mon, 31 Oct 2016 09:01:13 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EEB82928D for ; Mon, 31 Oct 2016 09:01:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9V8wwot007794; Mon, 31 Oct 2016 04:58:58 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u9T8E9YG026642 for ; Sat, 29 Oct 2016 04:14:09 -0400 Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9T8E8cv018744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 29 Oct 2016 04:14:08 -0400 Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) (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 DE3CE61B92; Sat, 29 Oct 2016 08:14:07 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id u84so3379324pfj.1; Sat, 29 Oct 2016 01:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G7kzzd7bmIt+NfosL14wcdNEgg1jww8EVG5MxPLoEBg=; b=RrRp4gHHYZk5BOnJGDXIIKYTxAzSC/rfY4e2O2/TeV8xMNHhFi18ySPdQ7v0eypxY+ fEMjkM2LKjO8k8Jwvi/TFtXczzxM/ao4hD5I26EuAAMg/fZco5V7dxh/+m0z8YWy22sN rMFxJ1KX3m0SN5gNVQRfeIyxJ2WboRMfYc4ZW4i4SQptPWciiEA7bDrHAJP3269dDFLq Ldc/WwVfQ5c7tMSgt8SEhtHHRfbzqijH9vfqMtvBSvaEe/0sEXbdew+L5LrSUjDk1RYJ qXKlDT9yzyPwA0ce41sTueaTQNiVNk0gOnr0EhXEC9GvI/tFWGIk8xt4jDEvQMh/gKX4 70RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G7kzzd7bmIt+NfosL14wcdNEgg1jww8EVG5MxPLoEBg=; b=K1IdCv9snoxL6D27cImrHUQQpw+HFNCJRPCJ3+GTXDq4VFWZKh4YRijBmvlftu2BMm hXRbUbiPST4UX8riRv5vfmq6+iC6mw2L+ObC5qpLQ8JdNmO2o658UEI+rkXztvW4g/62 irDgpZU967CgYWGAWyRPNE94pNMNKIliqwCW2JVwcBUKxbQ5c6Fo98B5yKX8jLekHDWF Rh6EXyu6tjGlof6d2A2eOpVL1Xtt4YEy7iCjSHm7hKZUSjPqAGqn/eMK5wzqGDvpjh5/ yl1mkeZMN7UrwW7mcJ88yZsiNAvCUV1aLzehSS6ePujxbMRfy87baSyCqOeWDE9PY333 e4wg== X-Gm-Message-State: ABUngve/jXMSh30gX5HyEjBgVAsYXDEwwrxPVXzGj6+v70vEIL2sz5Ap+9aw+caIle/aDA== X-Received: by 10.98.71.215 with SMTP id p84mr31742235pfi.59.1477728847406; Sat, 29 Oct 2016 01:14:07 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id o184sm23506924pfg.73.2016.10.29.01.14.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:14:06 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Date: Sat, 29 Oct 2016 16:08:28 +0800 Message-Id: <1477728600-12938-30-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-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.39]); Sat, 29 Oct 2016 08:14:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 29 Oct 2016 08:14:08 +0000 (UTC) for IP:'209.85.192.194' DOMAIN:'mail-pf0-f194.google.com' HELO:'mail-pf0-f194.google.com' FROM:'tom.leiming@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.689 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.192.194 mail-pf0-f194.google.com 209.85.192.194 mail-pf0-f194.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 31 Oct 2016 04:58:15 -0400 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" , "Kirill A . Shutemov" , linux-fsdevel@vger.kernel.org, Alasdair Kergon Subject: [dm-devel] [PATCH 29/60] dm: limit the max bio size as BIO_SP_MAX_SECTORS << SECTOR_SHIFT 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 and log write targets. 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 ef7bf1dd6900..ce454c6c1a4e 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 and log write. + * + * When these targets are ready for the big bio, we can remove + * the limit. + */ + ti->max_io_len = min_t(uint32_t, len, + BIO_SP_MAX_SECTORS << SECTOR_SHIFT); return 0; }