Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH] nvme-loop: Fix race between completions and shutdown
Date: Tue, 7 May 2019 00:07:47 +0900	[thread overview]
Message-ID: <0db7e312-0ff2-45f2-8ee1-7ad7b6fd3e5a@gmail.com> (raw)
In-Reply-To: <20190506145327.GA2164@localhost.localdomain>

On 5/6/19 11:53 PM, Keith Busch wrote:
> On Mon, May 06, 2019@11:52:03PM +0900, Minwoo Im wrote:
>>   static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl)
>>   {
>>   	if (ctrl->ctrl.queue_count > 1) {
>> +		nvme_start_freeze(&ctrl->ctrl);
>> +		nvme_wait_freeze(&ctrl->ctrl);
>> +
>>   		nvme_stop_queues(&ctrl->ctrl);
>>   		blk_mq_tagset_busy_iter(&ctrl->tag_set,
>>   					nvme_cancel_request, &ctrl->ctrl);
>>   		nvme_loop_destroy_io_queues(ctrl);
>> +
>> +		nvme_unfreeze(&ctrl->ctrl);
>>   	}
> 
> nvme_stop_queues() and blk_mq_tagset_busy_iter() really don't make sense
> to call on frozen queues.
> 

Hi Keith,
Thanks for your reply on this.

Actually the OOPS has occurred because blk_mq_tagset_busy_iter() 
iterates over a request which is now being completed by other CPU.

If don't mind, can I ask how can blk_mq_tagset_busy_iter() make sure 
that no more requests are coming into this request_queue during this 
iteration ?

Thanks,

  reply	other threads:[~2019-05-06 15:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 14:52 [PATCH] nvme-loop: Fix race between completions and shutdown Minwoo Im
2019-05-06 14:53 ` Keith Busch
2019-05-06 15:07   ` Minwoo Im [this message]
2019-05-06 15:17     ` Keith Busch
2019-05-06 15:46       ` Minwoo Im
2019-05-06 15:52       ` Minwoo Im
2019-05-06 15:56         ` Keith Busch
2019-05-06 16:25           ` Minwoo Im

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=0db7e312-0ff2-45f2-8ee1-7ad7b6fd3e5a@gmail.com \
    --to=minwoo.im.dev@gmail.com \
    /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