mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vhost_user_backend: call get_used_event from needs_notification
This change, combined with the compiler hint to inline get_used_event, shortens the window between the memory read and the actual check by calling get_used_event from needs_notification. Without it, when putting enough pressure on the vring, it's possible that a notification is wrongly omitted, causing the queue to stall. Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
committed by
Rob Bradford
parent
536323d9fb
commit
3957d1ee27
@@ -197,8 +197,7 @@ impl VhostUserBlkBackend {
|
||||
|
||||
if self.event_idx {
|
||||
if let Some(used_idx) = vring.mut_queue().add_used(mem, head.index, len) {
|
||||
let used_event = vring.mut_queue().get_used_event(mem);
|
||||
if vring.needs_notification(Wrapping(used_idx), used_event) {
|
||||
if vring.needs_notification(&mem, Wrapping(used_idx)) {
|
||||
debug!("signalling queue");
|
||||
vring.signal_used_queue().unwrap();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user