Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Yao Sang <sangyao@kylinos.cn>
Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH v1 2/2] nvme: stop using queue_limits_stack_bdev for namespace heads
Date: Mon, 20 Jul 2026 16:46:49 +0200	[thread overview]
Message-ID: <20260720144649.GC16699@lst.de> (raw)
In-Reply-To: <20260720022205.1798805-3-sangyao@kylinos.cn>

On Mon, Jul 20, 2026 at 10:22:05AM +0800, Yao Sang wrote:
> NVMe namespace heads are not generic stacked block devices.

Not many things actually are, which leads to every recurring problems
with the stacking scheme..

> Execution features and request limits continue to accumulate
> conservatively as paths are refreshed.

What is this supposed to mean?

> Keep the helper local to NVMe so its field ownership remains explicit and

What is "field ownership" supposed to mean?

> does not impose NVMe namespace-head policy on mapped devices.

I think you need to clearly state in what way we'll want to diverge
here.

> +static void nvme_apply_ns_head_identify_limits(struct queue_limits *lim,
> +					       const struct queue_limits *ns_lim)

Two tab indents, please.

>  {
> -	t->max_open_zones = min_not_zero(t->max_open_zones, b->max_open_zones);
> -	t->max_active_zones =
> -		min_not_zero(t->max_active_zones, b->max_active_zones);
> +	/*
> +	 * Identify-derived namespace/head attributes come from the refreshed
> +	 * NVMe namespace limits, not from generic mapped-device stacking.
> +	 */
> +	lim->features &= ~(BLK_FEAT_ZONED | BLK_FEAT_ATOMIC_WRITES);
> +	lim->features |= ns_lim->features & BLK_FEAT_ZONED;
> +	lim->logical_block_size = ns_lim->logical_block_size;
> +	lim->physical_block_size = ns_lim->physical_block_size;

A lot of this still duplicates the core code and creates a nightmare
when we add new fields.

Can you try to refactor the core code into lower level building
blocks and reuse as much as possible while also making the policy
differences clear?



  reply	other threads:[~2026-07-20 14:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  2:22 [PATCH v1 0/2] nvme: use local limits for namespace heads Yao Sang
2026-07-20  2:22 ` [PATCH v1 1/2] nvme: factor namespace-head queue-limit update Yao Sang
2026-07-20 14:42   ` Christoph Hellwig
2026-07-20  2:22 ` [PATCH v1 2/2] nvme: stop using queue_limits_stack_bdev for namespace heads Yao Sang
2026-07-20 14:46   ` Christoph Hellwig [this message]
2026-07-21 12:57     ` Yao Sang

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=20260720144649.GC16699@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=sangyao@kylinos.cn \
    /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