OSDN Git Service

exec/ram_addr: Return number of dirty pages in cpu_physical_memory_set_dirty_lebitmap()
authorJoao Martins <joao.m.martins@oracle.com>
Tue, 30 May 2023 18:05:55 +0000 (19:05 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 13 Jun 2023 09:28:58 +0000 (11:28 +0200)
commitf80929f3af3a67a8111fbd9fc73705d4814bcf85
tree23cb79e74a8914a45578e9617f672a4651276e54
parent9cc44d9bd6fb8ceb75f8ae898a0d167f6305e511
exec/ram_addr: Return number of dirty pages in cpu_physical_memory_set_dirty_lebitmap()

In preparation for including the number of dirty pages in the
vfio_get_dirty_bitmap() tracepoint, return the number of dirty pages in
cpu_physical_memory_set_dirty_lebitmap() similar to
cpu_physical_memory_sync_dirty_bitmap().

To avoid counting twice when GLOBAL_DIRTY_RATE is enabled, stash the
number of bits set per bitmap quad in a variable (@nbits) and reuse it
there.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230530180556.24441-2-joao.m.martins@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
include/exec/ram_addr.h