Re: [PATCH v11 4/6] x86/sev: Add support to perform RMP optimizations asynchronously

"Kalra, Ashish" <[email protected]> Mon, 3 Aug 2026 17:22:17 -0500
Newsgroups org.kernel.vger.kvm,dev.linux.lists.linux-coco,org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/3/2026 4:38 PM, Borislav Petkov wrote:
> On August 3, 2026 9:23:41 PM UTC, "Kalra, Ashish" <[email protected]> wrote:
>> yes, that's what the "optimizing during 1 GB page cleanup" sentence is about:
> 
> What about doing the optimization runs periodically?
> 

Periodic re-optimization was already considered in an earlier RMPOPT series and dropped because of being too disruptive — 
a timer-based scan would run on all cores every time it fires, even when no memory has been freed. Running it at guest
teardown (batched by the timeout) is a better fit: teardown is when large contiguous regions actually go back to the
hypervisor, so the scan only runs when there's real work to do instead of on a fixed timer. The case of a guest freeing
a 1 GB region mid-life is then handled by the 1 GB-hugetlb page-cleanup follow-on, not by a periodic scan.

I will also like to avoid looping on this — periodic vs teardown was already worked through in an earlier revision, and
this is where we landed. Happy to revisit if there's a specific new concern, but otherwise I'd prefer to keep the
current approach.

Thanks,
Ashish