Thread (112 messages) flat view 112 messages, 10 authors, 9h ago

Re: [PATCH v10 15/41] KVM: guest_memfd: Handle lru_add fbatch refcounts during conversion safety check

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-08-10 09:25:39
Also in: kvm, linux-coco, linux-doc, linux-kselftest, linux-mm, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help