public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@redhat.com>
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: Thu, 13 Feb 2025 00:33:20 -0800	[thread overview]
Message-ID: <Z62uUDSaVb3Qh0b6@infradead.org> (raw)
In-Reply-To: <20250210090319.1519778-1-ming.lei@redhat.com>

On Mon, Feb 10, 2025 at 05:03:19PM +0800, Ming Lei wrote:
> PAGE_SIZE is applied in some block device queue limits, this way is
> very fragile and is wrong:

Can you rephrase this?  what is "some block device queue limits"?

>  	}
>  
> diff --git a/block/blk.h b/block/blk.h
> index 90fa5f28ccab..cbfa8a3d4e42 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -359,7 +359,7 @@ static inline bool bio_may_need_split(struct bio *bio,
>  		const struct queue_limits *lim)
>  {
>  	return lim->chunk_sectors || bio->bi_vcnt != 1 ||
> -		bio->bi_io_vec->bv_len + bio->bi_io_vec->bv_offset > PAGE_SIZE;
> +		bio->bi_io_vec->bv_len + bio->bi_io_vec->bv_offset > BLK_MIN_SEGMENT_SIZE;

please avoid the overly long line here.  And maybe split up the
condition to actually be readable?  I.e.

	if (lim->chunk_sectors)
		return true;
	if (bio->bi_vcnt != 1)
		return true;
	if (bio->bi_io_vec->bv_len + bio->bi_io_vec->bv_offset >
	    BLK_MIN_SEGMENT_SIZE)
		return true;
	return false;

> +	BLK_MIN_SEGMENT_SIZE	= 4096, /* min(PAGE_SIZE) */

That's a very sparse and cryptic comment.  Please write down an
actual explanation.


  parent reply	other threads:[~2025-02-13  8:33 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 [this message]
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

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=Z62uUDSaVb3Qh0b6@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@redhat.com \
    --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