summary refs log tree commit diff stats
path: root/include/exec/memory.h
diff options
context:
space:
mode:
authorhongmianquan <hongmianquan@bytedance.com>2023-08-30 11:29:06 +0800
committerDavid Hildenbrand <david@redhat.com>2023-09-19 10:44:44 +0200
commit544cff46c018036cd66e98ffb224dd9f098065c8 (patch)
tree477137c59ce1112578104f1735c67c51c8d94689 /include/exec/memory.h
parent41ddcd2308f76cc95459c2961f4a50b66a70d3c4 (diff)
downloadfocaccia-qemu-544cff46c018036cd66e98ffb224dd9f098065c8.tar.gz
focaccia-qemu-544cff46c018036cd66e98ffb224dd9f098065c8.zip
memory: avoid updating ioeventfds for some address_space
When updating ioeventfds, we need to iterate all address spaces,
but some address spaces do not register eventfd_add|del call when
memory_listener_register() and they do nothing when updating ioeventfds.
So we can skip these AS in address_space_update_ioeventfds().

The overhead of memory_region_transaction_commit() can be significantly
reduced. For example, a VM with 8 vhost net devices and each one has
64 vectors, can reduce the time spent on memory_region_transaction_commit by 20%.

Message-ID: <20230830032906.12488-1-hongmianquan@bytedance.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: hongmianquan <hongmianquan@bytedance.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r--include/exec/memory.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index cc68249eda..ef23d65afc 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1095,6 +1095,7 @@ struct AddressSpace {
     struct FlatView *current_map;
 
     int ioeventfd_nb;
+    int ioeventfd_notifiers;
     struct MemoryRegionIoeventfd *ioeventfds;
     QTAILQ_HEAD(, MemoryListener) listeners;
     QTAILQ_ENTRY(AddressSpace) address_spaces_link;