Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-04 Thread Mike Snitzer
On Thu, Dec 03 2020 at 10:59pm -0500, Ming Lei wrote: > On Thu, Dec 03, 2020 at 09:03:43PM -0500, Mike Snitzer wrote: > > On Thu, Dec 03 2020 at 8:12pm -0500, > > Ming Lei wrote: > > > > > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > > > On Wed, Dec 02 2020 at 10:26pm -050

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-04 Thread Keith Busch
On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > On Wed, Dec 02 2020 at 10:26pm -0500, > Ming Lei wrote: > > > I understand it isn't related with correctness, because the underlying > > queue can split by its own chunk_sectors limit further. So is the issue > > too many further-spl

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Damien Le Moal
On 2020/12/04 11:11, Mike Snitzer wrote: > On Thu, Dec 03 2020 at 8:45pm -0500, > Ming Lei wrote: > >> On Thu, Dec 03, 2020 at 08:27:38AM -0800, Keith Busch wrote: >>> On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: On Wed, Dec 02 2020 at 10:26pm -0500, Ming Lei wrote: >

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Ming Lei
On Thu, Dec 03, 2020 at 09:03:43PM -0500, Mike Snitzer wrote: > On Thu, Dec 03 2020 at 8:12pm -0500, > Ming Lei wrote: > > > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > > On Wed, Dec 02 2020 at 10:26pm -0500, > > > Ming Lei wrote: > > > > > > > On Tue, Dec 01, 2020 at 11:

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Mike Snitzer
On Thu, Dec 03 2020 at 8:45pm -0500, Ming Lei wrote: > On Thu, Dec 03, 2020 at 08:27:38AM -0800, Keith Busch wrote: > > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > > On Wed, Dec 02 2020 at 10:26pm -0500, > > > Ming Lei wrote: > > > > > > > I understand it isn't related wi

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Mike Snitzer
On Thu, Dec 03 2020 at 8:12pm -0500, Ming Lei wrote: > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > On Wed, Dec 02 2020 at 10:26pm -0500, > > Ming Lei wrote: > > > > > On Tue, Dec 01, 2020 at 11:07:09AM -0500, Mike Snitzer wrote: > > > > commit 22ada802ede8 ("block: use lc

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Ming Lei
On Thu, Dec 03, 2020 at 08:27:38AM -0800, Keith Busch wrote: > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > On Wed, Dec 02 2020 at 10:26pm -0500, > > Ming Lei wrote: > > > > > I understand it isn't related with correctness, because the underlying > > > queue can split by its

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Ming Lei
On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > On Wed, Dec 02 2020 at 10:26pm -0500, > Ming Lei wrote: > > > On Tue, Dec 01, 2020 at 11:07:09AM -0500, Mike Snitzer wrote: > > > commit 22ada802ede8 ("block: use lcm_not_zero() when stacking > > > chunk_sectors") broke chunk_sectors

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Mike Snitzer
On Thu, Dec 03 2020 at 11:27am -0500, Keith Busch wrote: > On Thu, Dec 03, 2020 at 09:33:59AM -0500, Mike Snitzer wrote: > > On Wed, Dec 02 2020 at 10:26pm -0500, > > Ming Lei wrote: > > > > > I understand it isn't related with correctness, because the underlying > > > queue can split by its ow

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-03 Thread Mike Snitzer
On Wed, Dec 02 2020 at 10:26pm -0500, Ming Lei wrote: > On Tue, Dec 01, 2020 at 11:07:09AM -0500, Mike Snitzer wrote: > > commit 22ada802ede8 ("block: use lcm_not_zero() when stacking > > chunk_sectors") broke chunk_sectors limit stacking. chunk_sectors must > > reflect the most limited of all de

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-02 Thread Ming Lei
On Tue, Dec 01, 2020 at 11:07:09AM -0500, Mike Snitzer wrote: > commit 22ada802ede8 ("block: use lcm_not_zero() when stacking > chunk_sectors") broke chunk_sectors limit stacking. chunk_sectors must > reflect the most limited of all devices in the IO stack. > > Otherwise malformed IO may result. E

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-01 Thread Martin K. Petersen
Mike, > And since commit 07d098e6bbad ("block: allow 'chunk_sectors' to be > non-power-of-2") care must be taken to properly stack chunk_sectors to > be compatible with the possibility that a non-power-of-2 chunk_sectors > may be stacked. This is why gcd() is used instead of reverting back > to

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-01 Thread Jens Axboe
On 12/1/20 9:07 AM, Mike Snitzer wrote: > commit 22ada802ede8 ("block: use lcm_not_zero() when stacking > chunk_sectors") broke chunk_sectors limit stacking. chunk_sectors must > reflect the most limited of all devices in the IO stack. > > Otherwise malformed IO may result. E.g.: prior to this fix

Re: [dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-01 Thread John Dorminy
On Tue, Dec 1, 2020 at 11:07 AM Mike Snitzer wrote: > > commit 22ada802ede8 ("block: use lcm_not_zero() when stacking > chunk_sectors") broke chunk_sectors limit stacking. chunk_sectors must > reflect the most limited of all devices in the IO stack. > > Otherwise malformed IO may result. E.g.: pri

[dm-devel] [PATCH v2] block: use gcd() to fix chunk_sectors limit stacking

2020-12-01 Thread Mike Snitzer
commit 22ada802ede8 ("block: use lcm_not_zero() when stacking chunk_sectors") broke chunk_sectors limit stacking. chunk_sectors must reflect the most limited of all devices in the IO stack. Otherwise malformed IO may result. E.g.: prior to this fix, ->chunk_sectors = lcm_not_zero(8, 128) would res