Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-nvme@lists.infradead.org, kbusch@kernel.org, hch@lst.de,
	sagi@grimberg.me, axboe@fb.com, chaitanyak@nvidia.com,
	gjoyce@linux.ibm.com
Subject: Re: [PATCH 2/2] nvme: make keep-alive synchronous operation
Date: Mon, 7 Oct 2024 08:41:49 +0200	[thread overview]
Message-ID: <20241007064149.GB1141@lst.de> (raw)
In-Reply-To: <20241004114711.780809-3-nilay@linux.ibm.com>

On Fri, Oct 04, 2024 at 05:16:57PM +0530, Nilay Shroff wrote:
> The nvme keep-alive operation, which executes at a periodic interval,
> could potentially sneak in while shutting down a fabric controller.
> This may lead to a race between the fabric controller admin queue
> destroy code path (while shutting down controller) and the blk-mq
> hw/hctx queuing from the keep-alive thread.
> 
> This fix helps avoid race by implementing keep-alive as a synchronous
> operation so that admin queue-usage ref counter is decremented only
> after keep-alive command finish execution and returns its status.

With that you mean ->q_usage_counter?

Moving to synchronous submission and wasting a workqueue context for
that is a bit sad.  I think just removing the blk_mq_free_request call
from nvme_keep_alive_finish and returning RQ_END_IO_FREE instead
should have the same effect, or am I missing something?

> Also, while we are at it, instead of first acquiring ctrl lock and then
> accessing NVMe controller state, lets use the helper function
> nvme_ctrl_state() in nvme_keep_alive_end_io() and get rid of the
> lock.

Please split that into a separate patch.



  reply	other threads:[~2024-10-07  6:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 11:46 [PATCH 0/2] nvme: system fault while shutting down fabric controller Nilay Shroff
2024-10-04 11:46 ` [PATCH 1/2] nvme-loop: flush off pending I/O while shutting down loop controller Nilay Shroff
2024-10-07  6:37   ` Christoph Hellwig
2024-10-04 11:46 ` [PATCH 2/2] nvme: make keep-alive synchronous operation Nilay Shroff
2024-10-07  6:41   ` Christoph Hellwig [this message]
2024-10-07  7:55     ` Nilay Shroff

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=20241007064149.GB1141@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=chaitanyak@nvidia.com \
    --cc=gjoyce@linux.ibm.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.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