[PATCH 1/3] nvme: fixup kato deadlock

Christoph Hellwig hch at lst.de
Wed Mar 3 08:42:10 GMT 2021


On Tue, Mar 02, 2021 at 10:26:42AM +0100, Hannes Reinecke wrote:
> +	if (test_and_set_bit(NVME_CTRL_KATO_RUNNING, &ctrl->flags))
> +		return 0;
> +
>  	rq = nvme_alloc_request(ctrl->admin_q, &ctrl->ka_cmd,
> -			BLK_MQ_REQ_RESERVED);
> -	if (IS_ERR(rq))
> +			BLK_MQ_REQ_RESERVED | BLK_MQ_REQ_NOWAIT);
> +	if (IS_ERR(rq)) {
> +		clear_bit(NVME_CTRL_KATO_RUNNING, &ctrl->flags);
>  		return PTR_ERR(rq);
> +	}

Adding BLK_MQ_REQ_NOWAIT should be a separate prep patch, together with
reducing the number of reserved tags.

Also why do we still need the extra test_and_set_bit with the
NOWAIT allocation?




More information about the Linux-nvme mailing list