All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Saravanan D <saravanand@crusoe.ai>, linux-nvme@lists.infradead.org
Cc: kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, axboe@kernel.dk,
	dwagner@suse.de, sgogte@purestorage.com, hare@kernel.org,
	hare@suse.de, linux-kernel@vger.kernel.org, iyamahata@crusoe.ai,
	kiyer@crusoe.ai, ganbalagane@crusoe.ai, sjpark@crusoe.ai,
	bchen@crusoe.ai
Subject: Re: [PATCH v6 1/2] nvme: add per-queue sysfs directories
Date: Fri, 30 Oct 2026 20:16:21 +0530	[thread overview]
Message-ID: <10c9db86-4313-4a1e-bec1-e4eb9ae32ef0@linux.ibm.com> (raw)
In-Reply-To: <20261023230426.6425-2-saravanand@crusoe.ai>

On 10/24/26 4:34 AM, Saravanan D wrote:
> Per I/O queue transport state, such as the nvme-tcp io_cpu, has
> nowhere to live in sysfs, since the core has no directory for
> individual queues.
> 
> Add helpers that create the controller's queues directory and add or
> remove one directory per queue
> 
>    /sys/class/nvme/nvmeX/queues/<qid>/
> 
> carrying attributes provided by the transport. The transport creates
> the queues directory from its controller setup path, adds a queue's
> directory when it sets the queue up and removes it when it frees the
> queue, so the directories follow the queues across reconnects and
> changes in the queue count. The core allocates each queue directory
> and its release frees only that allocation. Removal waits for running
> attribute callbacks, so the transport may tear the queue down once it
> returns.
> 
> The queues directory holds a reference on the controller device, so
> nvme_uninit_ctrl() deletes it after the transport has removed the
> queue directories.
> 
> Suggested-by: Sagi Grimberg <sagi@grimberg.me>
> Link: https://lore.kernel.org/linux-nvme/13c160d0-0657-47ce-9a16-58d348267ab0@grimberg.me/
> Assisted-by: Claude:claude-opus-5-5 [Claude Code]
> Signed-off-by: Saravanan D <saravanand@crusoe.ai>
> ---
>   drivers/nvme/host/core.c  |  6 +++
>   drivers/nvme/host/nvme.h  | 23 ++++++++++
>   drivers/nvme/host/sysfs.c | 88 +++++++++++++++++++++++++++++++++++++++
>   3 files changed, 117 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 531f9bb14bab..41e1c9d0ee58 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -5153,6 +5153,12 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
>   {
>   	nvme_stop_keep_alive(ctrl);
>   	nvme_hwmon_exit(ctrl);
> +	/* transports remove their queue directories before this point */
> +	if (ctrl->queues_kobj) {
> +		kobject_del(ctrl->queues_kobj);
> +		kobject_put(ctrl->queues_kobj);
> +		ctrl->queues_kobj = NULL;
> +	}

Can we have a helper something like nvme_queue_dir_destroy()
and then call it here?

Thanks,
--Nilay



  reply	other threads:[~2026-10-30 14:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 23:04 [PATCH v6 0/2] nvme-tcp: allow setting per-queue io_cpu through sysfs Saravanan D
2026-10-23 23:04 ` [PATCH v6 1/2] nvme: add per-queue sysfs directories Saravanan D
2026-10-30 14:46   ` Nilay Shroff [this message]
2026-10-23 23:04 ` [PATCH v6 2/2] nvme-tcp: allow setting per-queue io_cpu through sysfs Saravanan D
2026-10-30 14:45   ` Nilay Shroff
2026-10-23 23:08 ` [PATCH blktests] nvme/075: test the per-queue io_cpu sysfs attribute Saravanan D
2026-10-29 11:50   ` Shin'ichiro Kawasaki
2026-10-30  0:23 ` [PATCH v6 0/2] nvme-tcp: allow setting per-queue io_cpu through sysfs Saravanan D

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=10c9db86-4313-4a1e-bec1-e4eb9ae32ef0@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=bchen@crusoe.ai \
    --cc=dwagner@suse.de \
    --cc=ganbalagane@crusoe.ai \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=iyamahata@crusoe.ai \
    --cc=kbusch@kernel.org \
    --cc=kiyer@crusoe.ai \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=saravanand@crusoe.ai \
    --cc=sgogte@purestorage.com \
    --cc=sjpark@crusoe.ai \
    /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.