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,
	dlemoal@kernel.org, gjoyce@linux.ibm.com
Subject: Re: [PATCH v3 2/3] nvme: make keep-alive synchronous operation
Date: Tue, 8 Oct 2024 09:04:59 +0200	[thread overview]
Message-ID: <20241008070459.GA22711@lst.de> (raw)
In-Reply-To: <20241008062210.1094083-3-nilay@linux.ibm.com>

On Tue, Oct 08, 2024 at 11:51:51AM +0530, Nilay Shroff wrote:
> This fix helps avoid race by implementing keep-alive as a synchronous
> operation so that admin queue-usage ref counter is decremented only

Please spell out q_usage_counter as requested in the first round.

> after keep-alive command finish execution and returns its status. This
> would ensure that we don't inadvertently destroy the fabric admin queue
> until we finish processing of nvme keep-alive request and its status and
> hence it's safe to delete the queue.

I still fail to see why this requires a synchronous operation vs just
calling blk_mq_free_request and thus decrementing q_usage_counter
afrer checking the controller state.

Maybe I'm just dumb and missing the obvious even after the last
explanation, but then the commit log needs to be improved to explain
it.


> -static enum rq_end_io_ret nvme_keep_alive_end_io(struct request *rq,
> -						 blk_status_t status)
> +static void nvme_keep_alive_finish(struct request *rq,
> +				blk_status_t status,
> +				struct nvme_ctrl *ctrl)

And as a nipick, this should be:

static void nvme_keep_alive_finish(struct request *rq, blk_status_t status,
		struct nvme_ctrl *ctrl)



  reply	other threads:[~2024-10-08  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  6:21 [PATCH v3 0/3] nvme: system fault while shutting down fabric controller Nilay Shroff
2024-10-08  6:21 ` [PATCH v3 1/3] nvme-loop: flush off pending I/O while shutting down loop controller Nilay Shroff
2024-10-08  6:21 ` [PATCH v3 2/3] nvme: make keep-alive synchronous operation Nilay Shroff
2024-10-08  7:04   ` Christoph Hellwig [this message]
2024-10-08 17:46     ` Nilay Shroff
2024-10-08  6:21 ` [PATCH v3 3/3] nvme: use helper nvme_ctrl_state in nvme_keep_alive_finish function Nilay Shroff
2024-10-08  7:06   ` Christoph Hellwig

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=20241008070459.GA22711@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=chaitanyak@nvidia.com \
    --cc=dlemoal@kernel.org \
    --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