Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-07-06 Thread Kent Overstreet
On Fri, Jul 01, 2022 at 11:58:35AM +0800, Ming Lei wrote: > Why do we need to pay the cost(4 bytes added to bio and the updating > in absolutely fast path) if rewind isn't used? So far, only dm requeue > needs it, and it is one very unusual event. > > Assuming fixed bio end sector should cover

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Ming Lei
On Wed, Jun 29, 2022 at 09:14:54PM -0400, Kent Overstreet wrote: > On Thu, Jun 30, 2022 at 08:47:13AM +0800, Ming Lei wrote: > > Or if I misunderstood your point, please cook a patch and I am happy to > > take a close look, and posting one very raw idea with random data > > structure looks not

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 11:16:10AM -0600, Jens Axboe wrote: > Not sure what Christoph change you are referring to, but all the ones > that I did to improve the init side were all backed by numbers I ran at > that time (and most/all of the commit messages will have that data). So > yes, it is

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 01:00:52PM -0600, Jens Axboe wrote: > On 6/29/22 12:40 PM, Kent Overstreet wrote: > > On Wed, Jun 29, 2022 at 11:16:10AM -0600, Jens Axboe wrote: > >> Not sure what Christoph change you are referring to, but all the ones > >> that I did to improve the init side were all

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 12:37:59PM -0700, Bart Van Assche wrote: > On 6/29/22 12:05, Kent Overstreet wrote: > > On Wed, Jun 29, 2022 at 11:51:27AM -0700, Bart Van Assche wrote: > > > On 6/29/22 11:40, Kent Overstreet wrote: > > > > But Jens, to be blunt - I know we have different priorities in the

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 11:51:27AM -0700, Bart Van Assche wrote: > On 6/29/22 11:40, Kent Overstreet wrote: > > But Jens, to be blunt - I know we have different priorities in the way we > > write code. > > Please stay professional in your communication and focus on the technical > issues instead

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Thu, Jun 30, 2022 at 08:47:13AM +0800, Ming Lei wrote: > Or if I misunderstood your point, please cook a patch and I am happy to > take a close look, and posting one very raw idea with random data > structure looks not helpful much for this discussion technically. Based it on your bio_rewind()

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 02:07:08AM -0400, Mike Snitzer wrote: > Please try to dial down the hyperbole and judgment. Ming wrote this > code. And you haven't been able to point out anything _actually_ wrong > with it (yet). > > This patch's header does need editing for clarity, but we can help >

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Thu, Jun 30, 2022 at 08:47:13AM +0800, Ming Lei wrote: > What is the difference between bio_set_pos and bio_rewind()? Both have > to restore bio->bi_iter(the sector part and the bvec part). > > Also how to update ->bi_done which 'counts bytes advanced'? You meant doing > it in > very

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-30 Thread Kent Overstreet
On Wed, Jun 29, 2022 at 12:37:59PM -0700, Bart Van Assche wrote: > On 6/29/22 12:05, Kent Overstreet wrote: > > On Wed, Jun 29, 2022 at 11:51:27AM -0700, Bart Van Assche wrote: > > > On 6/29/22 11:40, Kent Overstreet wrote: > > > > But Jens, to be blunt - I know we have different priorities in the

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Ming Lei
On Wed, Jun 29, 2022 at 02:11:54PM -0400, Kent Overstreet wrote: > On Wed, Jun 29, 2022 at 02:07:08AM -0400, Mike Snitzer wrote: > > Please try to dial down the hyperbole and judgment. Ming wrote this > > code. And you haven't been able to point out anything _actually_ wrong > > with it (yet). > >

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Jens Axboe
On Jun 29, 2022, at 1:26 PM, Kent Overstreet wrote: > > On Wed, Jun 29, 2022 at 01:00:52PM -0600, Jens Axboe wrote: >>> On 6/29/22 12:40 PM, Kent Overstreet wrote: >>> On Wed, Jun 29, 2022 at 11:16:10AM -0600, Jens Axboe wrote: Not sure what Christoph change you are referring to, but all

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Bart Van Assche
On 6/29/22 12:05, Kent Overstreet wrote: On Wed, Jun 29, 2022 at 11:51:27AM -0700, Bart Van Assche wrote: On 6/29/22 11:40, Kent Overstreet wrote: But Jens, to be blunt - I know we have different priorities in the way we write code. Please stay professional in your communication and focus

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Bart Van Assche
On 6/29/22 11:40, Kent Overstreet wrote: But Jens, to be blunt - I know we have different priorities in the way we write code. Please stay professional in your communication and focus on the technical issues instead of on the people involved. BTW, I remember that some time ago I bisected a

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Jens Axboe
On 6/29/22 12:40 PM, Kent Overstreet wrote: > On Wed, Jun 29, 2022 at 11:16:10AM -0600, Jens Axboe wrote: >> Not sure what Christoph change you are referring to, but all the ones >> that I did to improve the init side were all backed by numbers I ran at >> that time (and most/all of the commit

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Jens Axboe
On 6/28/22 12:32 PM, Kent Overstreet wrote: > On Tue, Jun 28, 2022 at 12:13:06PM -0600, Jens Axboe wrote: >> It's much less about using whatever amount of memory for inflight IO, >> and much more about not bloating fast path structures (of which the >> bio is certainly one). All of this gunk has

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Kent Overstreet
On Tue, Jun 28, 2022 at 01:41:12PM -0400, Mike Snitzer wrote: > On Tue, Jun 28 2022 at 12:36P -0400, > Kent Overstreet wrote: > > > On Tue, Jun 28, 2022 at 03:49:28PM +0800, Ming Lei wrote: > > > On Tue, Jun 28, 2022 at 12:26:10AM -0400, Kent Overstreet wrote: > > > > On Mon, Jun 27, 2022 at

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Kent Overstreet
On Tue, Jun 28, 2022 at 03:49:28PM +0800, Ming Lei wrote: > On Tue, Jun 28, 2022 at 12:26:10AM -0400, Kent Overstreet wrote: > > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > > > Not mention bio_iter, bvec_iter has been 32 bytes, which is too big to > > > hold in per-io data

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Kent Overstreet
On Tue, Jun 28, 2022 at 12:13:06PM -0600, Jens Axboe wrote: > It's much less about using whatever amount of memory for inflight IO, > and much more about not bloating fast path structures (of which the bio > is certainly one). All of this gunk has to be initialized for each IO, > and that's the

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Kent Overstreet
On Tue, Jun 28, 2022 at 03:42:52PM +0800, Ming Lei wrote: > I don't see there is 'queue depth' for bio or bio driver. > > 32 bytes have been big, and memory footprint is increased too since the data > has been > prepared for the future possible rewind. If crypt or integrity is considered, > it

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-29 Thread Mike Snitzer
On Tue, Jun 28 2022 at 1:52P -0400, Kent Overstreet wrote: > On Tue, Jun 28, 2022 at 01:41:12PM -0400, Mike Snitzer wrote: > > On Tue, Jun 28 2022 at 12:36P -0400, > > Kent Overstreet wrote: > > > > > On Tue, Jun 28, 2022 at 03:49:28PM +0800, Ming Lei wrote: > > > > On Tue, Jun 28, 2022 at

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Ming Lei
On Tue, Jun 28, 2022 at 12:36:17PM -0400, Kent Overstreet wrote: > On Tue, Jun 28, 2022 at 03:49:28PM +0800, Ming Lei wrote: > > On Tue, Jun 28, 2022 at 12:26:10AM -0400, Kent Overstreet wrote: > > > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > > > > Not mention bio_iter, bvec_iter

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Ming Lei
On Tue, Jun 28, 2022 at 12:13:06PM -0600, Jens Axboe wrote: > On 6/27/22 10:20 PM, Kent Overstreet wrote: > > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > >> On Sun, Jun 26, 2022 at 04:14:58PM -0400, Kent Overstreet wrote: > >>> On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Jens Axboe
On 6/27/22 10:20 PM, Kent Overstreet wrote: > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: >> On Sun, Jun 26, 2022 at 04:14:58PM -0400, Kent Overstreet wrote: >>> On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: Commit 7759eb23fd98 ("block: remove bio_rewind_iter()")

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Mike Snitzer
On Tue, Jun 28 2022 at 12:36P -0400, Kent Overstreet wrote: > On Tue, Jun 28, 2022 at 03:49:28PM +0800, Ming Lei wrote: > > On Tue, Jun 28, 2022 at 12:26:10AM -0400, Kent Overstreet wrote: > > > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > > > > Not mention bio_iter, bvec_iter has

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Ming Lei
On Tue, Jun 28, 2022 at 12:26:10AM -0400, Kent Overstreet wrote: > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > > Not mention bio_iter, bvec_iter has been 32 bytes, which is too big to > > hold in per-io data structure. With this patch, 8bytes is enough > > to rewind one bio if the

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Ming Lei
On Tue, Jun 28, 2022 at 12:20:16AM -0400, Kent Overstreet wrote: > On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > > On Sun, Jun 26, 2022 at 04:14:58PM -0400, Kent Overstreet wrote: > > > On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > > > > Commit 7759eb23fd98 ("block:

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Kent Overstreet
On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > Commit 7759eb23fd98 ("block: remove bio_rewind_iter()") removes > the similar API because the following reasons: > > ``` > It is pointed that bio_rewind_iter() is one very bad API[1]: > > 1) bio size may not be restored

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Kent Overstreet
On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > On Sun, Jun 26, 2022 at 04:14:58PM -0400, Kent Overstreet wrote: > > On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > > > Commit 7759eb23fd98 ("block: remove bio_rewind_iter()") removes > > > the similar API because the

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-28 Thread Kent Overstreet
On Mon, Jun 27, 2022 at 03:36:22PM +0800, Ming Lei wrote: > Not mention bio_iter, bvec_iter has been 32 bytes, which is too big to > hold in per-io data structure. With this patch, 8bytes is enough > to rewind one bio if the end sector is fixed. And with rewind, you're making an assumption about

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-27 Thread Ming Lei
On Sun, Jun 26, 2022 at 02:37:22PM -0700, Eric Biggers wrote: > On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > > diff --git a/block/blk-crypto.c b/block/blk-crypto.c > > index a496aaef85ba..caae2f429fc7 100644 > > --- a/block/blk-crypto.c > > +++ b/block/blk-crypto.c > > @@ -134,6

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-27 Thread Ming Lei
On Sun, Jun 26, 2022 at 04:14:58PM -0400, Kent Overstreet wrote: > On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > > Commit 7759eb23fd98 ("block: remove bio_rewind_iter()") removes > > the similar API because the following reasons: > > > > ``` > > It is pointed that

Re: [dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-26 Thread Eric Biggers
On Fri, Jun 24, 2022 at 10:12:52PM +0800, Ming Lei wrote: > diff --git a/block/blk-crypto.c b/block/blk-crypto.c > index a496aaef85ba..caae2f429fc7 100644 > --- a/block/blk-crypto.c > +++ b/block/blk-crypto.c > @@ -134,6 +134,21 @@ void bio_crypt_dun_increment(u64 >

[dm-devel] [PATCH 5.20 1/4] block: add bio_rewind() API

2022-06-24 Thread Ming Lei
Commit 7759eb23fd98 ("block: remove bio_rewind_iter()") removes the similar API because the following reasons: ``` It is pointed that bio_rewind_iter() is one very bad API[1]: 1) bio size may not be restored after rewinding 2) it causes some bogus change, such as 5151842b9d8732