nvme: use a semaphore to guard submission queue
The current command submission logic in nvme suffers from the fact that it can fail iff the queue is full. This complicates a bunch of places where commands are submitted as we always need to check for errors.
It makes much more sense to have a semaphore as part of each queue pair that guards submission of commands. That will allow for a lot cleaner code in many places. The downside of this is that we might end up blocking in command submission if the queues are really small, but as we're only submitting commands in places where we can block I see no problem there.
Updated by Hans Rosenfeld almost 5 years ago
I have extensively tested this code in combination with #8629, but also without it. My tests consisted of a number of repeated parallel iozone processes running on Intel P3700 and Samsung SM951 devices. I did not observe any hangs or other weird behavior with this change.
This change has been in illumos-joyent since July.
Updated by Electric Monk almost 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 4b324362d54967a3ccfad8a9b113978ea1b38feb Author: Hans Rosenfeld <firstname.lastname@example.org> Date: 2017-09-25T09:11:07.000Z 8628 nvme: use a semaphore to guard submission queue Reviewed by: Jerry Jelinek <email@example.com> Reviewed by: Jason King <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Garrett D'Amore <firstname.lastname@example.org> Approved by: Richard Lowe <email@example.com>