]> git.baikalelectronics.ru Git - kernel.git/commit
ringtest: poll for new buffers once before updating event index
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 6 Oct 2016 09:39:12 +0000 (11:39 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 30 Oct 2016 22:21:43 +0000 (00:21 +0200)
commitbbe512ef9b43b0868f7b5adddb5ff094368f4270
treeb74d1bb2f74384b1a57209bf2d0f453de3968347
parent7f10fd73065e41bbb6fe564538db816da5f1f1eb
ringtest: poll for new buffers once before updating event index

Updating the event index has a memory barrier and causes more work
on the other side to actually signal the event.  It is unnecessary
if a new buffer has already appeared on the ring, so poll once before
doing the update.

The effect of this on the 0.9 ring implementation is pretty much
invisible, but on the new-style ring it provides a consistent 3%
performance improvement.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/ringtest/main.c