Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2722886yba; Mon, 8 Apr 2019 03:20:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIVUj8GpbKXzJF7xT0gseT0u1qdnWWIM1TRO5o9+LTlYr0J8cmAHbQcKw4XehVl5pORsjx X-Received: by 2002:a63:5405:: with SMTP id i5mr27327677pgb.212.1554718843592; Mon, 08 Apr 2019 03:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554718843; cv=none; d=google.com; s=arc-20160816; b=hoQZnnhT6LxEXZNrQ+zkT4nDF/2G0iI4DOQHso251G8GKpJxUj489L/09gnJ/8alGO OGwb8WKVSTzw0U3bwvKnE6SnkLYFY86OHJxg/NtpWUIYJbsi0XSflMlW+RR1SSGdfBCG akqnJPR1Q5MaS5tNlOyeT2MURG+mTClpQCEr0gTJ1oiM0kSviscVm0PCtn/cZjFcxujV bNafYDVg5JIqSYzi4TgXropPJzLdAicnsY24h2/fGuvHmzU+hE0cmu/TA4JiualpoYwr O5++jXdhvoL/ScVYDdBr2/flSEVfpHZru6GnKYXO2rjbunbGWDcEWuiWrNWuFgejGgVa XVTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BK+8RJRL/YUgoAdoPrMtcQWtoLiTJEXAzr7iCxvRVew=; b=CoUSHjDT4bBHhSpSurHojjaNvQENADJ38LZhpSTojhRwASzpMinILT6b0/pZbNCP/m sw7v5k3wtRKlOaBYLNNNKNI5hXYxoWj5Ii3MT6Py5m+OhxmLL6ZAC4NVD9xG+6GrXG+X sMybntPTvvXmW0W6RAyiGtYUxJ7pMDqizlGvrv4pJAedWOcRWRlNJSBqEstda8zHqy7A cL0ciCCrOOm9Qc+XSLCxMI+xxAG2GAN0hqriSUuyWVNEyGR7FP1ujZp5F4/XDWCqQagV SqGeIepeSldjjc9VBlEhpxkQTIR/3n6QzZfojvBAZETA62mQhQ5Yqh7qT1S8NcaIaorI C8Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si25435645pgg.15.2019.04.08.03.20.28; Mon, 08 Apr 2019 03:20:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbfDHKTR (ORCPT + 99 others); Mon, 8 Apr 2019 06:19:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42628 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfDHKTR (ORCPT ); Mon, 8 Apr 2019 06:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1CEC81113; Mon, 8 Apr 2019 10:19:16 +0000 (UTC) Received: from ming.t460p (ovpn-8-31.pek2.redhat.com [10.72.8.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2679760CD0; Mon, 8 Apr 2019 10:19:08 +0000 (UTC) Date: Mon, 8 Apr 2019 18:19:04 +0800 From: Ming Lei To: Johannes Thumshirn Cc: Nikolay Borisov , Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org, LKML , linux-btrfs Subject: Re: Possible bio merging breakage in mp bio rework Message-ID: <20190408101903.GC19589@ming.t460p> References: <59c19acf-999f-1911-b0b8-1a5cec8116c5@suse.com> <20190406001653.GA4805@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 08 Apr 2019 10:19:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 08, 2019 at 11:52:59AM +0200, Johannes Thumshirn wrote: > On 06/04/2019 02:16, Ming Lei wrote: > > Hi Nikolay, > > > > On Fri, Apr 05, 2019 at 07:04:18PM +0300, Nikolay Borisov wrote: > >> Hello Ming, > >> > >> Following the mp biovec rework what is the maximum > >> data that a bio could contain? Should it be PAGE_SIZE * bio_vec > > > > There isn't any maximum data limit on the bio submitted from fs, > > and block layer will make the final bio sent to driver correct > > by applying all kinds of queue limit, such as max segment size, > > max segment number, max sectors, ... > > Naive question, why are we creating possibly huge bios just to split > them according the the LLDD's limits afterwards? bio split is one important IO model in block layer, which simplifies stacked driver(dm, md, bcache, ...) a lot. It is very reasonable to apply the queue limits in its. make_request_fn(). Otherwise, it will cause huge mess in stacking driver if queue limits are applied in bio_add_page(), see previous .merge_bvec_fn's implementation in these stacking drivers. Not only bio_add_page(), there is also bio clone involved. > > Can't we look at the limits in e.g. bio_add_page() and decide if we need > to split there? bio_add_page() is absolutely the fast path, and it is much more efficient to apply the limit just once in the queue's .make_request_fn. Thanks, Ming