From patchwork Tue May 2 03:42:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9707411 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 7A77B602F0 for ; Tue, 2 May 2017 03:47:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69E60204BD for ; Tue, 2 May 2017 03:47:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EF4D2074F; Tue, 2 May 2017 03:47:15 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0294A204BD for ; Tue, 2 May 2017 03:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387AbdEBDrO (ORCPT ); Mon, 1 May 2017 23:47:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:34574 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752383AbdEBDrM (ORCPT ); Mon, 1 May 2017 23:47:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B63BAAB07; Tue, 2 May 2017 03:46:55 +0000 (UTC) From: NeilBrown To: Jens Axboe Date: Tue, 02 May 2017 13:42:26 +1000 Subject: [PATCH 13/13] block: don't check for BIO_MAX_PAGES in blk_bio_segment_split() Cc: linux-block@vger.kernel.org, Ming Lei , linux-kernel@vger.kernel.org Message-ID: <149369654638.5146.3067734913419940612.stgit@noble> In-Reply-To: <149369628671.5146.4865312503373040039.stgit@noble> References: <149369628671.5146.4865312503373040039.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP blk_bio_segment_split() makes sure bios have no more than BIO_MAX_PAGES entries in the bi_io_vec. This was done because bio_clone_bioset() (when given a mempool bioset) could not handle larger io_vecs. No driver uses bio_clone_bioset() any more, they all use bio_clone_fast() if anything, and bio_clone_fast() doesn't clone the bi_io_vec. The main user of of bio_clone_bioset() at this level is bounce.c, and bouncing now happens before blk_bio_segment_split(), so that is not of concern. So remove the big helpful comment and the code. Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig --- block/blk-merge.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index e7862e9dcc39..cea544ec5d96 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -108,25 +108,9 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, bool do_split = true; struct bio *new = NULL; const unsigned max_sectors = get_max_io_size(q, bio); - unsigned bvecs = 0; bio_for_each_segment(bv, bio, iter) { /* - * With arbitrary bio size, the incoming bio may be very - * big. We have to split the bio into small bios so that - * each holds at most BIO_MAX_PAGES bvecs because - * bio_clone_bioset() can fail to allocate big bvecs. - * - * Those drivers which will need to use bio_clone_bioset() - * should tell us in some way. For now, impose the - * BIO_MAX_PAGES limit on all queues. - * - * TODO: handle users of bio_clone_bioset() differently. - */ - if (bvecs++ >= BIO_MAX_PAGES) - goto split; - - /* * If the queue doesn't support SG gaps and adding this * offset would create a gap, disallow it. */