All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Mohamed Khalfella <mkhalfella@purestorage.com>
Cc: James Smart <james.smart@broadcom.com>,
	Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	randyj@purestorage.com, jrani@purestorage.com
Subject: Re: nvme-fc: Question about __nvme_fc_abort_outstanding_ios()
Date: Thu, 9 Jan 2025 09:59:03 +0800	[thread overview]
Message-ID: <Z38tZ99hIX2stF8L@fedora> (raw)
In-Reply-To: <Z38nGkThjH59LFrf@ceto>

On Wed, Jan 08, 2025 at 05:32:10PM -0800, Mohamed Khalfella wrote:
> Hello,
> 
> I was looking at this code and I had a question about it.
> 
> drivers/nvme/host/fc.c
> 2473 static void
> 2474 __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
> 2475 {
> ...
> ...
> 2503                 blk_mq_tagset_busy_iter(&ctrl->tag_set,
> 2504                                 nvme_fc_terminate_exchange, &ctrl->ctrl);
> 2505                 blk_mq_tagset_wait_completed_request(&ctrl->tag_set);
> 
> nvme_fc_terminate_exchange() calls __nvme_fc_abort_op() to abort all active
> ops with status FCPOP_STATE_ACTIVE. I think these active ops map to in-flight
> requests MQ_RQ_IN_FLIGHT. After blk_mq_tagset_busy_iter() returns it is not
> guaranteed that all ops had done callback functions called on them. Some
> of these requests might still be in-flight.
> 
> blk_mq_tagset_wait_completed_request() makes sure that we do not have pending
> completed requests, but it does not check for in-flight requests?

It is because many callbacks call blk_mq_complete_request() to complete
request, and the request may be completed remotely via IPI, that is why
blk_mq_tagset_wait_completed_request() is needed.


Thanks, 
Ming



  reply	other threads:[~2025-01-09  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09  1:32 nvme-fc: Question about __nvme_fc_abort_outstanding_ios() Mohamed Khalfella
2025-01-09  1:59 ` Ming Lei [this message]
2025-01-09 17:52   ` Mohamed Khalfella

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=Z38tZ99hIX2stF8L@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=jrani@purestorage.com \
    --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 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.