[PATCH] nvme: handle completions outside of the queue lock

Keith Busch keith.busch at linux.intel.com
Thu May 17 08:03:52 PDT 2018


On Thu, May 17, 2018 at 12:47:32AM -0700, Christoph Hellwig wrote:
>  static irqreturn_t nvme_irq_check(int irq, void *data)
> @@ -1039,7 +1024,14 @@ static int __nvme_poll(struct nvme_queue *nvmeq, unsigned int tag)
>  	nvme_process_cq(nvmeq, &start, &end);
>  	spin_unlock_irq(&nvmeq->q_lock);
>  
> -	return nvme_complete_cqes(nvmeq, start, end, tag);
> +	while (start != end) {
> +		if (nvme_handle_cqe(nvmeq, start, tag))
> +			return 1;

We can't return early from here anymore since the new interface moved
the CQ head. No one else is going to get to see those completions, so
the first caller owns completing everything up to the end that it claimed.



More information about the Linux-nvme mailing list