The optimization improves performance by letting each side of the ring know what was the last index read by the remote party. In case were the other side has older indexes, waiting for processing we won't trigger another update (kick or irq, depending on the direction). The optimization reduces irq injection by a 7%.
Along the way, collapse vring::need_event to the code and use std::atomic(s) to access any variable which is shared w/ the host
26e046a Implement event index, a virtio optimization
drivers/virtio-vring.cc | 33 +++++++++++++++++++--------------
drivers/virtio-vring.hh | 28 +++++++++++++++++-----------
drivers/virtio.cc | 3 +++
drivers/virtio.hh | 5 ++++-
4 files changed, 43 insertions(+), 26 deletions(-)
Upstream: github.com