]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration/postcopy: Cache the tid->vcpu mapping for blocktime
authorPeter Xu <peterx@redhat.com>
Fri, 13 Jun 2025 14:12:13 +0000 (10:12 -0400)
committerFabiano Rosas <farosas@suse.de>
Fri, 11 Jul 2025 13:37:38 +0000 (10:37 -0300)
commit28a185204ee9a4dd1b0da38c92f2d9326ca590d5
tree50253014cc2ed3d9b0d8e64b1f2e39ca0164a112
parentf07f2a3092b70d407a009dae28b44ecc8fbcffb7
migration/postcopy: Cache the tid->vcpu mapping for blocktime

Looking up the vCPU index for each fault can be expensive when there're
hundreds of vCPUs.  Provide a cache for tid->vcpu instead with a hash
table, then lookup from there.

When at it, add another counter to record how many non-vCPU faults it gets.
For example, the main thread can also access a guest page that was missing.
These kind of faults are not accounted by blocktime so far.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20250613141217.474825-11-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
migration/postcopy-ram.c
migration/trace-events