Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2380358rwl; Thu, 30 Mar 2023 09:29:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aV9l2BseHuK7WiN5euPBxkt809SxdhEMnUwzp/2btNXGkxO01CfoF7qqqEAS8TkpN7ftTm X-Received: by 2002:a05:6402:524e:b0:502:465:28e0 with SMTP id t14-20020a056402524e00b00502046528e0mr2866458edd.0.1680193769219; Thu, 30 Mar 2023 09:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680193769; cv=none; d=google.com; s=arc-20160816; b=Uz/BEhqAG6cfNOlhc6oaatZkEIViUWLubYV3fsg8ULKziQ9xogxCUUlx6JsE765bkg seT1UegHefLixTLdrrCqntQzOm2lHqfYgzdtdN+HQoKi7QBBPRohC1hewr3wNWc3WNGH mNYVx2OePf9q+v0urgXYzpe/jv9CUn+6FZhClE1RPms29JqG6ks890umv2EItlrtn+F9 PYS0q5pxiiujIVBYI7c6wUc4yKgH9hIJFB6zqjicqSuys+DO/ip1NFrECsOZUSe6bwAo GvRX2JU3eIqE41Bu7YR2TdRKB267mnYMLhzXtUgQF8VGArH4S8vB540AxXOSZTOUBBL4 +eQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=wWLlciqwRfofnoVgofNDoDEIRXrlVm6b9CM/A7H2cxc=; b=I7GglgjX7Zl5WDUvRqFpgEey+7K6LPrxIFCkAny7zYX9UU+1eOIbpvMVU8MLRC16nw dAaGcFqUKT5xjqmXfFjJSjZXRnTXT53ZPD0mcaWnQ5bO+t3/fkon9DZs+UGUDz1DqWMc pCRJ8wwVXoHvxdJu7MyEU3nP5KQQKrQitG0PWL2wRYfTwBbanvtYDIj2lI7j6M/VMjV0 ubPIantQ2EyGVWUXyZzRAiw6KMuH2WclbBM+igU2NsUNuBiRCyyphBrZnSH++L+PlFyi BEJd/W2nJ58Qxi7LpVRAy6D9wDcI9+7/350FPoROC2eYu2jiKU79TGUQXVlKgI+dDuBW Vw1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SEFi96CL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020a056402101300b005024c84f442si113470edu.662.2023.03.30.09.29.03; Thu, 30 Mar 2023 09:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SEFi96CL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbjC3QUc (ORCPT + 99 others); Thu, 30 Mar 2023 12:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjC3QUa (ORCPT ); Thu, 30 Mar 2023 12:20:30 -0400 Received: from out-10.mta0.migadu.com (out-10.mta0.migadu.com [91.218.175.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB22B756 for ; Thu, 30 Mar 2023 09:20:28 -0700 (PDT) Date: Thu, 30 Mar 2023 12:20:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680193226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wWLlciqwRfofnoVgofNDoDEIRXrlVm6b9CM/A7H2cxc=; b=SEFi96CLZZpO5S41cm2o4hB9YxU9oubwwDBdWVZufD5quY6qg6tIAEH0wCMjsRldsK0Pn2 oZiIoYZdfOzRn5gusS/03gtKIGtioqX/BxrgPCXeevZq7jyqMgjB5H8pMBqM04oyCqHtUm bTREaKUzZ3ap7MU6Qi448ARAS5eqBFo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Ming Lei Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, willy@infradead.org, axboe@kernel.dk, Phillip Lougher Subject: Re: [PATCH 1/2] block: Rework bio_for_each_segment_all() Message-ID: References: <20230327174402.1655365-1-kent.overstreet@linux.dev> <20230327174402.1655365-2-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 07:49:23PM +0800, Ming Lei wrote: > bio_for_each_segment_all is supposed to be used by bio which owns the > bvec table, so it is just fine to return bvec pointer by bio_for_each_segment_all > to save extra bvec copy. No. And you wrote this code, so I'd expect you to know this: bio_for_each_segment_all() can _not_ return a pointer into the original bvec table, it has to synthesize bvecs - same as regular bio_for_each_segment() - because it has to break bvecs up into individiual pages. There was zero benefit to the way you were doing it, you were just adding pointer access to something that was on the caller's stack. > And the change becomes not efficient any more. Based on _what_? Code size doesn't change, as I already showed hch. What's your claim?