All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: John Dorminy <jdorminy@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-block <linux-block@vger.kernel.org>,
	device-mapper development <dm-devel@redhat.com>,
	Bruce Johnston <bjohnsto@redhat.com>
Subject: Re: [dm-devel] block: revert to using min_not_zero() when stacking chunk_sectors
Date: Mon, 30 Nov 2020 21:12:06 -0500	[thread overview]
Message-ID: <20201201021206.GB13735@redhat.com> (raw)
In-Reply-To: <CAMeeMh9Ykqhc75VCSgLoj+hMpqBaV2uY7XvXUP1-FQdQLF49Ew@mail.gmail.com>

On Mon, Nov 30 2020 at  7:21pm -0500,
John Dorminy <jdorminy@redhat.com> wrote:

> > If you're going to cherry pick a portion of a commit header please
> > reference the commit id and use quotes or indentation to make it clear
> > what is being referenced, etc.
> Apologies.
> 
> > Quite the tangent just to setup an a toy example of say: thinp with 256K
> > blocksize/chunk_sectors ontop of a RAID6 with a chunk_sectors of 128K
> > and stripesize of 1280K.
> 
> I screwed up my math ... many apologies :/
> 
> Consider a thinp of chunk_sectors 512K atop a RAID6 with chunk_sectors 1280K.
> (Previously, this RAID6 would be disallowed because chunk_sectors
> could only be a power of 2, but 07d098e6bba removed this constraint.)

Think you have your example messed up still.  RAID 10+2 with 128K
chunk_sectors, 1280K full stripe (io_opt). Then thinp stacked ontop of
it with chunk_sectors of 1280K was usecase that wasn't supported before.

So stacked chunk_sectors = min_not_zero(128K, 1280K) = 128K

> -With lcm_not_zero(), a full-device IO would be split into 2560K IOs,
> which obviously spans both 512K and 1280K chunk boundaries.

Sure, think we both agree lcm_not_zero() shouldn't be used.

> -With min_not_zero(), a full-device IO would be split into 512K IOs,
> some of which would span 1280k chunk boundaries. For instance, one IO
> would span from offset 1024K to 1536K.

RAID6 with chunk_sectors of 1280K is pretty insane...
And yet you're saying full device IO is 1280K...
So something still isn't adding up.

Anyway, if we run with your example of chunk_sectors (512K, 1280K), yes
there is serious potential for IO to span the RAID6 layer's chunk_sector
boundary.

> -With the hypothetical gcd_not_zero(), a full-device IO would be split
> into 256K IOs, which span neither 512K nor 1280K chunk boundaries.

Yeap, I see.

> > To be clear, you are _not_ saying using lcm_not_zero() is correct.
> > You're saying that simply reverting block core back to using
> > min_not_zero() may not be as good as using gcd().
> 
> Assuming my understanding of chunk_sectors is correct -- which as per
> blk-settings.c seems to be "a driver will not receive a bio that spans
> a chunk_sector boundary, except in single-page cases" -- I believe
> using lcm_not_zero() and min_not_zero() can both violate this
> requirement. The current lcm_not_zero() is not correct, but also
> reverting block core back to using min_not_zero() leaves edge cases as
> above.

But your chunk_sectors (512K, 1280K) example is a misconfigured IO
stack.  Really not sure it worth being concerned about it.

> I believe gcd provides the requirement, but min_not_zero() +
> disallowing non-power-of-2 chunk_sectors also provides the
> requirement.

Kind of on the fence on this... think I'd like to get Martin's take.

Using gcd() instead of min_not_zero() to stack chunk_sectors isn't a big
deal; given the nature of chunk_sectors coupled with it being able to be
a non-power-of-2 _does_ add a new wrinkle.

So you had a valid point all along, just that you made me work pretty
hard to understand you.

> > > But it's possible I'm misunderstanding the purpose of chunk_sectors,
> > > or there should be a check that the one of the two devices' chunk
> > > sizes divides the other.
> >
> > Seriously not amused by your response, I now have to do damage control
> > because you have a concern that you really weren't able to communicate
> > very effectively.
> 
> Apologies.

Eh, I need to build my pain threshold back up.. been away from it all
for more than a week.. ;)

Mike

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: John Dorminy <jdorminy@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-block <linux-block@vger.kernel.org>,
	device-mapper development <dm-devel@redhat.com>,
	Bruce Johnston <bjohnsto@redhat.com>
Subject: Re: block: revert to using min_not_zero() when stacking chunk_sectors
Date: Mon, 30 Nov 2020 21:12:06 -0500	[thread overview]
Message-ID: <20201201021206.GB13735@redhat.com> (raw)
In-Reply-To: <CAMeeMh9Ykqhc75VCSgLoj+hMpqBaV2uY7XvXUP1-FQdQLF49Ew@mail.gmail.com>

On Mon, Nov 30 2020 at  7:21pm -0500,
John Dorminy <jdorminy@redhat.com> wrote:

> > If you're going to cherry pick a portion of a commit header please
> > reference the commit id and use quotes or indentation to make it clear
> > what is being referenced, etc.
> Apologies.
> 
> > Quite the tangent just to setup an a toy example of say: thinp with 256K
> > blocksize/chunk_sectors ontop of a RAID6 with a chunk_sectors of 128K
> > and stripesize of 1280K.
> 
> I screwed up my math ... many apologies :/
> 
> Consider a thinp of chunk_sectors 512K atop a RAID6 with chunk_sectors 1280K.
> (Previously, this RAID6 would be disallowed because chunk_sectors
> could only be a power of 2, but 07d098e6bba removed this constraint.)

Think you have your example messed up still.  RAID 10+2 with 128K
chunk_sectors, 1280K full stripe (io_opt). Then thinp stacked ontop of
it with chunk_sectors of 1280K was usecase that wasn't supported before.

So stacked chunk_sectors = min_not_zero(128K, 1280K) = 128K

> -With lcm_not_zero(), a full-device IO would be split into 2560K IOs,
> which obviously spans both 512K and 1280K chunk boundaries.

Sure, think we both agree lcm_not_zero() shouldn't be used.

> -With min_not_zero(), a full-device IO would be split into 512K IOs,
> some of which would span 1280k chunk boundaries. For instance, one IO
> would span from offset 1024K to 1536K.

RAID6 with chunk_sectors of 1280K is pretty insane...
And yet you're saying full device IO is 1280K...
So something still isn't adding up.

Anyway, if we run with your example of chunk_sectors (512K, 1280K), yes
there is serious potential for IO to span the RAID6 layer's chunk_sector
boundary.

> -With the hypothetical gcd_not_zero(), a full-device IO would be split
> into 256K IOs, which span neither 512K nor 1280K chunk boundaries.

Yeap, I see.

> > To be clear, you are _not_ saying using lcm_not_zero() is correct.
> > You're saying that simply reverting block core back to using
> > min_not_zero() may not be as good as using gcd().
> 
> Assuming my understanding of chunk_sectors is correct -- which as per
> blk-settings.c seems to be "a driver will not receive a bio that spans
> a chunk_sector boundary, except in single-page cases" -- I believe
> using lcm_not_zero() and min_not_zero() can both violate this
> requirement. The current lcm_not_zero() is not correct, but also
> reverting block core back to using min_not_zero() leaves edge cases as
> above.

But your chunk_sectors (512K, 1280K) example is a misconfigured IO
stack.  Really not sure it worth being concerned about it.

> I believe gcd provides the requirement, but min_not_zero() +
> disallowing non-power-of-2 chunk_sectors also provides the
> requirement.

Kind of on the fence on this... think I'd like to get Martin's take.

Using gcd() instead of min_not_zero() to stack chunk_sectors isn't a big
deal; given the nature of chunk_sectors coupled with it being able to be
a non-power-of-2 _does_ add a new wrinkle.

So you had a valid point all along, just that you made me work pretty
hard to understand you.

> > > But it's possible I'm misunderstanding the purpose of chunk_sectors,
> > > or there should be a check that the one of the two devices' chunk
> > > sizes divides the other.
> >
> > Seriously not amused by your response, I now have to do damage control
> > because you have a concern that you really weren't able to communicate
> > very effectively.
> 
> Apologies.

Eh, I need to build my pain threshold back up.. been away from it all
for more than a week.. ;)

Mike


  reply	other threads:[~2020-12-01  2:12 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 17:18 [dm-devel] [PATCH] block: revert to using min_not_zero() when stacking chunk_sectors Mike Snitzer
2020-11-30 17:18 ` Mike Snitzer
2020-11-30 20:51 ` [dm-devel] " John Dorminy
2020-11-30 20:51   ` John Dorminy
2020-11-30 23:24   ` [dm-devel] " Mike Snitzer
2020-11-30 23:24     ` Mike Snitzer
2020-12-01  0:21     ` [dm-devel] " John Dorminy
2020-12-01  0:21       ` John Dorminy
2020-12-01  2:12       ` Mike Snitzer [this message]
2020-12-01  2:12         ` Mike Snitzer
2020-12-01 16:07 ` [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking Mike Snitzer
2020-12-01 16:07   ` Mike Snitzer
2020-12-01 17:43   ` [dm-devel] " John Dorminy
2020-12-01 17:43     ` John Dorminy
2020-12-01 17:53   ` [dm-devel] " Jens Axboe
2020-12-01 17:53     ` Jens Axboe
2020-12-01 18:02   ` [dm-devel] " Martin K. Petersen
2020-12-01 18:02     ` Martin K. Petersen
2020-12-02  3:38   ` [dm-devel] [PATCH] dm: " Jeffle Xu
2020-12-02  3:38     ` Jeffle Xu
2020-12-02  3:38     ` [dm-devel] " Jeffle Xu
2020-12-02  3:38       ` Jeffle Xu
2020-12-02  3:57       ` [dm-devel] " JeffleXu
2020-12-02  3:57         ` JeffleXu
2020-12-02  5:03         ` [dm-devel] " Mike Snitzer
2020-12-02  5:03           ` Mike Snitzer
2020-12-02  5:14           ` [dm-devel] " Mike Snitzer
2020-12-02  5:14             ` Mike Snitzer
2020-12-02  6:31             ` [dm-devel] " JeffleXu
2020-12-02  6:31               ` JeffleXu
2020-12-02  6:35               ` [dm-devel] " JeffleXu
2020-12-02  6:35                 ` JeffleXu
2020-12-02  6:28           ` [dm-devel] " JeffleXu
2020-12-02  6:28             ` JeffleXu
2020-12-02  7:10           ` [dm-devel] " JeffleXu
2020-12-02  7:10             ` JeffleXu
2020-12-02 15:11             ` [dm-devel] " Mike Snitzer
2020-12-02 15:11               ` Mike Snitzer
2020-12-03  1:48               ` [dm-devel] " JeffleXu
2020-12-03  1:48                 ` JeffleXu
2020-12-03  3:26   ` [dm-devel] [PATCH v2] block: " Ming Lei
2020-12-03  3:26     ` Ming Lei
2020-12-03 14:33     ` [dm-devel] " Mike Snitzer
2020-12-03 14:33       ` Mike Snitzer
2020-12-03 16:27       ` [dm-devel] " Keith Busch
2020-12-03 16:27         ` Keith Busch
2020-12-03 17:56         ` [dm-devel] " Mike Snitzer
2020-12-03 17:56           ` Mike Snitzer
2020-12-04  1:45         ` [dm-devel] " Ming Lei
2020-12-04  1:45           ` Ming Lei
2020-12-04  2:11           ` [dm-devel] " Mike Snitzer
2020-12-04  2:11             ` Mike Snitzer
2020-12-04  6:22             ` [dm-devel] " Damien Le Moal
2020-12-04  6:22               ` Damien Le Moal
2020-12-04  1:12       ` Ming Lei
2020-12-04  1:12         ` Ming Lei
2020-12-04  2:03         ` [dm-devel] " Mike Snitzer
2020-12-04  2:03           ` Mike Snitzer
2020-12-04  3:59           ` [dm-devel] " Ming Lei
2020-12-04  3:59             ` Ming Lei
2020-12-04 16:47             ` [dm-devel] " Mike Snitzer
2020-12-04 16:47               ` Mike Snitzer
2020-12-04 17:32               ` [dm-devel] [RFC PATCH] dm: fix IO splitting [was: Re: [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking] Mike Snitzer
2020-12-04 17:32                 ` Mike Snitzer
2020-12-04 17:49                 ` [dm-devel] " Mike Snitzer
2020-12-04 17:49                   ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201021206.GB13735@redhat.com \
    --to=snitzer@redhat.com \
    --cc=bjohnsto@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jdorminy@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.