Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp498698imu; Fri, 16 Nov 2018 05:56:09 -0800 (PST) X-Google-Smtp-Source: AJdET5doQb4Zxs2lEAb1jo1uX6jl0v0g6TWXWqyyTpaCIfAGks329ANDmIMOaCSAm927O2y7UDfR X-Received: by 2002:a63:78cd:: with SMTP id t196mr10052401pgc.62.1542376569426; Fri, 16 Nov 2018 05:56:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542376569; cv=none; d=google.com; s=arc-20160816; b=c1aCS2DB0sSZy/1pw/A7lHIScmiB/2ty/umjEb5ao3sNnyDgIwvyw/IAiQkZexWHD2 UvFpWBnypK7OR6zRp8QpMswQACs1IotiKkTmBdiIjmPZds29Om/SdoqTZ/3pFUl240C0 Nmn3Al4UWoLGcnqqGih7k6g+BoD49o5NMnr91niAkAhNJUh3hto0W/9xYB8jlnXOjFaJ Ld5YhKLEUx0601s/acl6BKzkisZKieNs2DG1cxTUuCYb5szQ08XvI32dZgw6kGOW6kqj rlLSukMp96LgE1av+EV98QGAeyNR2Zmtt7vl+3uUbtrB1nccT8Gq49Dqx2xMiiUwN2jP 6Wsw== 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=By5RUL5vIbs9aLqHuBxIHAaaZegMR+UCHflSmj/f1i0=; b=ZZXk3GQbbsiBaZZ6i4cAOw05v0fFl50eMZOfzzDyVgPrHes7kcCkgw1K1e50qHdVY1 UJlyh12TtD2LHMI51Es3B86WjzULpCPYq5JUuIS/GRQhXxp9MQ3QY+kS2KW+CCqqbOvW 5Kt7oOk8qRqj6DWqxqLt2klQHpq8ie75zgdHQsyr7OVuTrq0rtK+4N4vvK1Z3rRb7HaB AwpcmsKpMhvPboyX6wMqHIyvi0BF1nGeKHwSBSbo1/S6d69jZCl5ca65enW+POaYq02+ c+956bkW/GTVlTAGFlV+e3q4BBNRQ05zLwAAISaBYzVoy9O27/GHLa+7BrrQhCH3sUzn NS5g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1-v6si33085914plb.153.2018.11.16.05.55.54; Fri, 16 Nov 2018 05:56:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389828AbeKQAHo (ORCPT + 99 others); Fri, 16 Nov 2018 19:07:44 -0500 Received: from verein.lst.de ([213.95.11.211]:50081 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727727AbeKQAHo (ORCPT ); Fri, 16 Nov 2018 19:07:44 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 445C568D60; Fri, 16 Nov 2018 14:55:12 +0100 (CET) Date: Fri, 16 Nov 2018 14:55:12 +0100 From: Christoph Hellwig To: Ming Lei 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 , Christoph Hellwig , 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 17/19] block: don't use bio->bi_vcnt to figure out segment number Message-ID: <20181116135512.GM3165@lst.de> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-18-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115085306.9910-18-ming.lei@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 04:53:04PM +0800, Ming Lei wrote: > It is wrong to use bio->bi_vcnt to figure out how many segments > there are in the bio even though CLONED flag isn't set on this bio, > because this bio may be splitted or advanced. > > So always use bio_segments() in blk_recount_segments(), and it shouldn't > cause any performance loss now because the physical segment number is figured > out in blk_queue_split() and BIO_SEG_VALID is set meantime since > bdced438acd83ad83a6c ("block: setup bi_phys_segments after splitting"). Looks good, but shouldn't this go to the beginning of the series? Reviewed-by: Christoph Hellwig