[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZCW2xmJmVnFtRV2/@moria.home.lan>
Date: Thu, 30 Mar 2023 12:20:22 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Ming Lei <ming.lei@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
willy@...radead.org, axboe@...nel.dk,
Phillip Lougher <phillip@...ashfs.org.uk>
Subject: Re: [PATCH 1/2] block: Rework bio_for_each_segment_all()
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?
Powered by blists - more mailing lists