[PATCH] NVMe: limit max completion iterations in nvme_process_cq()

Keith Busch keith.busch at intel.com
Fri Nov 14 09:56:43 PST 2014


On Fri, 14 Nov 2014, Jens Axboe wrote:
> This is an unbounded loop. If we have per-cpu queues this is
> usually not a problem, but if CPUs share a queue, then we could
> have some of them continually queueing IO and the loop could take
> forever to exit.
>
> Limit max iterations to the queue depth of the given completion
> queue, which seems like a nice number to use.

I think the loop implicitly already has the same max iteration: the
queue lock is held when it's called, so new commands can't be posted on
the submission queue while the completions are reaped, so we can't loop
more than the depth.



More information about the Linux-nvme mailing list