[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/p2m: don't request mapcache invalidation for altp2m removals
- To: Michał Leszczyński <ml@xxxxxxxxx>
- From: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
- Date: Mon, 23 Nov 2026 08:30:18 -0500
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=tklengyel.com; spf=pass smtp.mailfrom=tamas@xxxxxxxxxxxxx; dmarc=pass header.from=<tamas@xxxxxxxxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795440659; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=Jx2fDvn6M7gyopzeyprlj9vgeulRtIPP8pE+WzwAzCg=; b=HFL6bTm1lEhoyCSERPLeDP9gB+XfKQ1y7YEmXx7wpL9L3T2VZTSbiqZJiqKQ3WTcwj/2w859pjPB/5+1LFKl3C5c7m9lKKDdA8pg9m4rDyrIkYXdjAg2E+AJN+BtaNsQ3SmoPedSdmzlNwGA49V/kFCM7gv+VEg081gJE4vBDu8=
- Arc-seal: i=1; a=rsa-sha256; t=1795440659; cv=none; d=zohomail.com; s=zohoarc; b=I+1eJzWRMlckTAVeCi1rKlGDPJtLRfq2n4J2rxeD7WpI48n9jiVJGi1xbv3tcoXqew6N0181imOPZckhOODUEkEySlxcH2ZIo8533hXzXI8E+aSOreXO+AoohIbSQVXqOShLx032EV0ZURbKmCj4R7Is5qI0HqoglGHyNf+Y5hM=
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=zmail header.d=tklengyel.com header.i="@tklengyel.com" header.h="Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:Subject:To"
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
- Delivery-date: Mon, 23 Nov 2026 13:31:08 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, Nov 22, 2026 at 11:08 PM Michał Leszczyński < ml@xxxxxxxxx> wrote: From: Michał Leszczyński <ml@xxxxxxxxx>
Since commit 588d961d15d1, p2m_remove_entry() requests a mapcache
invalidation for every removal, including altp2m entries removed via
p2m_change_altp2m_gfn(). Device models map guest memory through the
host p2m, so such removals cannot leave them with stale mappings.
When the request is issued by another domain, every vCPU of the guest
synchronously broadcasts IOREQ_TYPE_INVALIDATE on its next hypercall.
DRAKVUF triggers this whenever it removes the last breakpoint from a
page.
This was measured on Xen 4.22.0 with QEMU 9.1 and a 2-vCPU Windows 10
guest, benchmarking a dummy application which calls NtCreateFile in a loop
while DRAKVUF's filetracer plugin is tracing those calls. On every such
syscall entry, the plugin places a temporary trap on the return address,
to be able to observe syscall's return value. The trap is removed after
the observation is made. Thus, every syscall translates to altp2m entry
addition and removal under this benchmark scenario.
Without this change, each traced call took about 8.1 ms.
With patch it goes down to about 0.19 ms (~43 times faster!)
Only request the invalidation for the host p2m.
Fixes: 588d961d15d1 ("IOREQ: refine when to send mapcache invalidation request")
Backport: 4.15+
Signed-off-by: Michał Leszczyński <ml@xxxxxxxxx>
It's great to see you still working on Xen & DRAKVUF! :)
Cheers, Tamas
|