[PATCH 2/5] nvme: Ending failed unstarted requests

jianchao.wang jianchao.w.wang at oracle.com
Mon Jan 22 18:29:58 PST 2018


Hi Keith

On 01/23/2018 05:56 AM, Keith Busch wrote:
>  	nvme_cancel_requests(&dev->ctrl);
>  	/*
>  	 * The driver will not be starting up queues again if shutting down so
> -	 * must flush all entered requests to their failed completion to avoid
> +	 * must end all entered requests to their failed completion to avoid
>  	 * deadlocking blk-mq hot-cpu notifier.
>  	 */
>  	if (shutdown)
> -		nvme_start_queues(&dev->ctrl);
> +		nvme_end_requests(&dev->ctrl);
The blk-mq cpuhp notifier has been changed by Christoph's 4b855ad (blk-mq: Create hctx for each present CPU),
the deadlocking here should have been fixed here.
So the comment here should be modified at least to avoid confusion.
On the other hand, we needn't freeze the queue for reset case, the device will be setup soon later, just 
quiesce the blk-mq queue should be ok. And regarding to the shutdown case, frozen and drained queue will
be safer. To drain the queue, we have to unquiesce it.
Finally, we get a quiesced queue for reset case, and frozen and drained queue for shutdown case.

Thanks
Jianchao



More information about the Linux-nvme mailing list