On 8/7/26 23:52, Ackerley Tng via B4 Relay wrote:
From: Ackerley Tng <redacted>
A guest_memfd folio is safe for conversion if guest_memfd holds the last
references on it. Any other references on the folio may indicate another
user, and guest_memfd cannot convert it to private if there may be an
existing host user.
A folio will have extra refcounts if it is present in a per-CPU lru_add
fbatch. guest_memfd does not actually participate in LRU, but
freshly-allocated folios are still added to the lru_add fbatch for batch
LRU statistics processing.
As discussed, what would happen if we mlocked gmem folios? In that case, they
could also have been added to the mlock cache (which we treat like an LRU cache).
But that's just a comment regarding the text here.
[...]
--
Cheers,
David