Re: [PATCH v10 12/41] KVM: guest_memfd: Call arch make_shared callback for to-shared conversion
From: Sean Christopherson
Date: Fri Aug 14 2026 - 11:05:20 EST
On Thu, Aug 13, 2026, Ackerley Tng wrote:
> Sean Christopherson <seanjc@xxxxxxxxxx> writes:
> > That's why I think it's worth analyzing the cost: if it's in the
> > noise, leave it alone. If it's meaningful, figure out a not-too-gross way to skip
> > the entire thing if kvm_arch_gmem_make_shared() is a glorified nop in the end.
>
> Is noise defined relative to the entire conversion process? Would this
> benchmark look like
>
> 1. Convert 4G to shared on TDX with CONFIG_AMD_SEV defined
> 2. Convert 4G to shared on TDX without CONFIG_AMD_SEV defined
>
> and then compare the difference in time taken?
That'd work, though I was envisioning something even simpler: use rdtsc() to
count the cycles it takes to iterate over various ranges of memory. Do whatever
is easiest for you though.