Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2452133imu; Mon, 19 Nov 2018 00:20:43 -0800 (PST) X-Google-Smtp-Source: AJdET5eZIB2AMUNlfenGkGZ3A1DBKL1yT+FKcEHNvFaFBiGGl3wI5pz745SkWQtbubaNSXncWgvd X-Received: by 2002:a63:f844:: with SMTP id v4mr19076657pgj.82.1542615643902; Mon, 19 Nov 2018 00:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542615643; cv=none; d=google.com; s=arc-20160816; b=Kax8c/luq7Um+FCpP4dYiT2HdYKjIpAoaB8brltWbp8m0cdVd/aP+kRXVms9x09BwO mcjVGyGOTCFr/2QJQ9o2iX992K/UfdcW/AzPvv2IZRzDVqTvS0aKyF9a+y9FegFrFlqu wkLlF3uUkXe8ZbOmRdEenbPnCP07K6U9g/GPTLfOIvP//QnMlrzQHMB2zIidfcCEvWsA TR+hJihtuxv7vDWe6+hybRaIRp0cH+Kx2qJV4YTpBi0TA1NH3R/U9KdsUHRNsdNkVUrf CGeCwFyUg8iTUjxGFcqYzazRWw3jQUmiAeufFgRD7vCOcWU6JOynvI4Rp7WihXvvxuF2 SxrQ== 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=OHdRf8dEOic9dMC0LjeDboKE2uzr2veGCZULvQdrCR4=; b=BEuDmb+5TaiDAO8gUTWlXi2EjDzlx4zsB0D8aVbwGMUwtMwb90/CHxdgmQJF8AtLLs m5VEmMXhHVkd0/cXdX+Qr8lPQPMt5uxKev8i57JJm9vJHouPMmxVth9VhzkQOtjrh6IG DG+yhIDlZCFOYWfbqeWpoFM+gdoA6jeGJeM/ttkuvRrpzLftsBDbgUgoYJe0JIac/hvS xv9/x2wKMD7eqDhZG4zUl0LuH4M911FXhBEv/TszQThcqnCe6UE+7JC8KNPEagiMqpxc G27yYkh80Z7qG9JyMIrsJN23IKhGzkk0pcCp8DSIS0+lvv+JnLNegAL0gVp9fM2jUgIq bEig== 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 x2-v6si37628412plo.259.2018.11.19.00.20.28; Mon, 19 Nov 2018 00:20:43 -0800 (PST) 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 S1726984AbeKSSmo (ORCPT + 99 others); Mon, 19 Nov 2018 13:42:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbeKSSmo (ORCPT ); Mon, 19 Nov 2018 13:42:44 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46775307D91A; Mon, 19 Nov 2018 08:19:50 +0000 (UTC) Received: from ming.t460p (ovpn-8-26.pek2.redhat.com [10.72.8.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E334B5D70A; Mon, 19 Nov 2018 08:19:28 +0000 (UTC) Date: Mon, 19 Nov 2018 16:19:24 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Theodore Ts'o , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs Message-ID: <20181119081922.GB16736@ming.t460p> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-9-ming.lei@redhat.com> <20181116133845.GG3165@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116133845.GG3165@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 19 Nov 2018 08:19:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt may not equal to number of pages after multipage bvec > > is enabled. > > btrfs only uses the value to check if it is larger than 1. No amount > of multipage bio merging should ever make bi_vcnt go from 0 to 1 or > vice versa. Could you explain a bit why? Suppose 2 physically continuous pages are added to this bio, .bi_vcnt can be 1 in case of multi-page bvec, but it is 2 in case of single-page bvec. Thanks, Ming