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

Borislav Petkov <[email protected]> Tue, 4 Aug 2026 17:49:13 -0700
Newsgroups org.kernel.vger.linux-crypto,dev.linux.lists.linux-coco,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <20260805004913.GBanKIiW-O3pDjIqjH@fat_crate.local>
On Mon, Aug 03, 2026 at 05:22:17PM -0500, Kalra, Ashish wrote:
> Periodic re-optimization was already considered in an earlier RMPOPT se=
ries

Link?

> and dropped because of being too disruptive =E2=80=94 a timer-based sca=
n would run
> on all cores every time it fires, even when no memory has been freed.

What if it ran very seldomly, say once an hour?

> 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 th=
en
> handled by the 1 GB-hugetlb page-cleanup follow-on, not by a periodic s=
can.

Are you saying a periodic scan won't handle anything?

Because if it catches something, it will handle that something.

> I will also like to avoid looping on this =E2=80=94 periodic vs teardow=
n was already
> worked through in an earlier revision, and this is where we landed. Hap=
py to
> revisit if there's a specific new concern, but otherwise I'd prefer to =
keep
> the current approach.

Sorry, this is not how upstream review works.

--=20
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette