virtio: Re-enable notifications after drain
Merge Request Required Information
Jira: https://issues.redhat.com/browse/RHEL-3934
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=58869483
Summary of Changes
When using aio_set_event_notifier_poll(), the io_poll_end() callback is only invoked when polling ends, not when the notifier is being removed while in a polling section. This can leave the virtqueue notifier disabled during drained sections, which however is not a bad thing. We just need to ensure they are re-enabled after the drain, and kick the virtqueue
once to pick up all the requests that came in during the drained section. This is done by patch 2.
Patch 1 fixes virtio_scsi_drained_end() so it won’t attach polling notifiers for the event virtqueue. That didn’t turn out to be an issue so far, but was reported to become an issue with patch 2 applied (virtqueue processing spinning in a loop).
Patch 3 is a clean-up for virtio_blk_start_ioeventfd(): It kicks the virtqueues once to start processing any requests therein, before attaching the host notifier; but patch 2 has made it so that attaching the host notifier kicks the virtqueue anyway, so now they’d be kicked twice. Patch 3 effectively removes the explicit kick from virtio_blk_start_ioeventfd(), leaving it to virtio_queue_aio_attach_host_notifier().
git-backport-diff
$ git backport-diff -r c9s.. -u upstream/master
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/3:[----] [--] 'virtio-scsi: Attach event vq notifier with no_poll'
002/3:[----] [--] 'virtio: Re-enable notifications after drain'
003/3:[----] [--] 'virtio-blk: Use ioeventfd_attach in start_ioeventfd'