From 536323d9fb52b9caa4d37e6e419ed438d67e6329 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Tue, 10 Mar 2020 05:37:23 -0400 Subject: [PATCH] vm-virtio: queue: hint that get_used_event should be inlined get_used_event is used from vhost_user_backend:needs_notification to check whether an interrupt must be sent to the guest to notify there are new items in the queue. Shorten the update window by asking the the compiler to inline this method, so a write won't slip between the read of the memory contents and the actual check. Signed-off-by: Sergio Lopez --- vm-virtio/src/queue.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/vm-virtio/src/queue.rs b/vm-virtio/src/queue.rs index 23b86991c..5c6532a16 100644 --- a/vm-virtio/src/queue.rs +++ b/vm-virtio/src/queue.rs @@ -548,6 +548,7 @@ impl Queue { } /// Return the value present in the used_event field of the avail ring. + #[inline(always)] pub fn get_used_event(&self, mem: &GuestMemoryMmap) -> Option> { let avail_ring = self.avail_ring; let used_event_addr =