public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Daniel Gomez <da.gomez@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Yi Zhang <yi.zhang@redhat.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	John Garry <john.g.garry@oracle.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH V2] block: make segment size limit workable for > 4K PAGE_SIZE
Date: Fri, 14 Feb 2025 20:51:52 +0800	[thread overview]
Message-ID: <Z688aFX58AbEqyW5@fedora> (raw)
In-Reply-To: <xjuuc5qqgy6ujywimm2poxibbhsh5zbsefqeiqjru7q2llmjoj@spht3a4bx555>

On Fri, Feb 14, 2025 at 01:28:41PM +0100, Daniel Gomez wrote:
> On Fri, Feb 14, 2025 at 07:19:45PM +0100, Ming Lei wrote:
> > On Fri, Feb 14, 2025 at 10:38:36AM +0100, Daniel Gomez wrote:
> > > On Mon, Feb 10, 2025 at 05:03:19PM +0100, Ming Lei wrote:
> > > >  /**
> > > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > > > index 248416ecd01c..32188af4051e 100644
> > > > --- a/include/linux/blkdev.h
> > > > +++ b/include/linux/blkdev.h
> > > > @@ -1163,6 +1163,7 @@ static inline bool bdev_is_partition(struct block_device *bdev)
> > > >  enum blk_default_limits {
> > > >  	BLK_MAX_SEGMENTS	= 128,
> > > >  	BLK_SAFE_MAX_SECTORS	= 255,
> > > > +	BLK_MIN_SEGMENT_SIZE	= 4096, /* min(PAGE_SIZE) */
> > > 
> > > I think it would be useful to expose this value to the queue_limits and
> > 
> > Can you share it is useful for what?
> 
> I meant for your use case.

No, it isn't single case, there are many such devices with < 64K
max_segment_size, please see previous Bart's post:

https://lore.kernel.org/linux-block/20230612203314.17820-1-bvanassche@acm.org/

> 
> > 
> > > sysfs (and remove it from here). We can default it to PAGE_SIZE (as it has
> > > always been) and allow to overwrite it when the block driver initializes the
> > 
> > Which device driver needs to initialize it?
> 
> I mean, it would be yours. Keeping the default minimum segment size to PAGE_SIZE
> rather than changing it to 4k, would keep the current behaviour. Then, adding
> the minimum segment limit would allow your driver to overwrite it for your use
> case.

But these devices doesn't export min_segment_size, why do you want to fake this
limit?

It is fragile to take variable PAGE_SIZE as soft min_segment_size, and
it is actually wrong to bind it with fixed hardware max_segment_size.

To be honest, not see any benefit with your approach, just make things
complicated.

Thanks,
Ming


      reply	other threads:[~2025-02-14 12:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  9:03 [PATCH V2] block: make segment size limit workable for > 4K PAGE_SIZE Ming Lei
2025-02-10 12:14 ` Hannes Reinecke
2025-02-10 13:26   ` Ming Lei
2025-02-10 20:17 ` Luis Chamberlain
2025-02-11  2:10   ` Ming Lei
2025-02-13  7:34     ` Daniel Gomez
2025-02-13  8:02       ` Ming Lei
2025-02-13  8:30         ` Christoph Hellwig
2025-02-13  8:51           ` Ming Lei
2025-02-13 14:18             ` Daniel Gomez
2025-02-14  1:37               ` Ming Lei
2025-02-13  8:33 ` Christoph Hellwig
2025-02-13  8:45 ` John Garry
2025-02-13  9:58   ` Ming Lei
2025-02-13 10:23     ` John Garry
2025-02-13 10:35       ` Ming Lei
2025-02-13 11:12         ` John Garry
2025-02-13 11:33           ` Ming Lei
2025-02-13 11:41             ` John Garry
2025-02-14  9:38 ` Daniel Gomez
2025-02-14 11:19   ` Ming Lei
2025-02-14 12:28     ` Daniel Gomez
2025-02-14 12:51       ` Ming Lei [this message]

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=Z688aFX58AbEqyW5@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=da.gomez@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=yi.zhang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox