mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Surabhi Gogte (she/her)" <sgogte@purestorage.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>,
	 linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	 mkhalfella@purestorage.com, randyj@purestorage.com,
	adailey@purestorage.com
Subject: Re: [PATCH v2 2/2] nvme-tcp: parallelize I/O queue allocation and startup
Date: Thu, 10 Sep 2026 13:32:05 -0700	[thread overview]
Message-ID: <CAMof9cUv3EbdppfCSK++QO_-AgmqqpqO8AyajwUTjxt-mBQX0Q@mail.gmail.com> (raw)
In-Reply-To: <39448561-8877-4e20-98e6-fd85acc3d569@grimberg.me>

On Sat, Sep 5, 2026 at 3:30 PM Sagi Grimberg <sagi@grimberg.me> wrote:
>
> >>>                qid, queue->io_cpu);
> >>> @@ -1846,7 +1856,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
> >>>                queue->cmnd_capsule_len = sizeof(struct nvme_command) +
> >>>                                                NVME_TCP_ADMIN_CCSZ;
> >>>
> >>> -     ret = sock_create_kern(current->nsproxy->net_ns,
> >>> +     ret = sock_create_kern(&init_net,
> >> I don't think we can just change this...
> > Passing init_net explicitly does change behavior on the synchronous connect
> > path. However, with queue allocation now moved into an async worker,
> > current->nsproxy->net_ns resolves to init_net in that context anyway, so
> > the initial connect path already loses the caller's netns regardless of
> > which argument is passed.
> >
> > If the goal is to actually preserve the caller's netns through the full
> > ctrl lifecycle - initial connect, reconnect, and error recovery; it can
> > be pinned at ctrl creation like:
> >
> >      nvme_tcp_alloc_ctrl():
> >              to_tcp_ctrl(ctrl)->net = get_net(current->nsproxy->net_ns);
> >
> >      nvme_tcp_free_ctrl():
> >              put_net(to_tcp_ctrl(ctrl)->net);
> >
> >      nvme_tcp_alloc_queue():
> >              sock_create_kern(to_tcp_ctrl(ctrl)->net, ...);
> >
> > This captures the caller's netns while still in userspace context, then
> > carries it through all async paths — so reconnect and error recovery
> > also honor the original netns rather than falling back to the kworker's
> > init_net.
> >
> > Is this approach preferred?
>
> Yes I think so

Alright, sent the patch with the implementation in v3

      reply	other threads:[~2026-09-10 20:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 22:56 [PATCH v2 0/2] nvme-tcp: parallelize I/O queue connect Surabhi Gogte
2026-08-24 22:56 ` [PATCH v2 1/2] nvme-tcp: refactor I/O queue setup path Surabhi Gogte
2026-08-24 23:36   ` Randy Jennings
2026-08-30 21:56   ` Sagi Grimberg
2026-09-02 21:25     ` Surabhi Gogte (she/her)
2026-08-24 22:56 ` [PATCH v2 2/2] nvme-tcp: parallelize I/O queue allocation and startup Surabhi Gogte
2026-08-24 23:58   ` Randy Jennings
2026-08-30 22:00   ` Sagi Grimberg
2026-08-30 22:25     ` Mohamed Khalfella
2026-08-30 22:44       ` Sagi Grimberg
2026-08-30 22:59         ` Mohamed Khalfella
2026-09-04 16:04           ` Surabhi Gogte (she/her)
2026-09-05 22:29             ` Sagi Grimberg
2026-09-04 16:05     ` Surabhi Gogte (she/her)
2026-09-05 22:30       ` Sagi Grimberg
2026-09-10 20:32         ` Surabhi Gogte (she/her) [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=CAMof9cUv3EbdppfCSK++QO_-AgmqqpqO8AyajwUTjxt-mBQX0Q@mail.gmail.com \
    --to=sgogte@purestorage.com \
    --cc=adailey@purestorage.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mkhalfella@purestorage.com \
    --cc=randyj@purestorage.com \
    --cc=sagi@grimberg.me \
    /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

all inboxes | Powered by JetHome®