On 11.12.24 16:45, Matthew Wilcox wrote:
On Wed, Dec 11, 2024 at 03:49:12PM +0100, David Hildenbrand wrote:
On 11.12.24 15:25, Ryan Roberts wrote:
On 11/12/2024 11:56, David Hildenbrand wrote:
Now CCing the correct Willy :)
On 11.12.24 12:55, David Hildenbrand wrote:
Hi,
PageAnonExclusive (PAE) is working very reliable at this point. But
especially in the context of THPs (large folios) we'd like to do better:
(1) For PTE-mapped THP, we have to maintain it per page. We'd like to
avoid per-page flags as good as possible (e.g., waste in "struct
page", touching many cachelines).
Presumably also important for the Glorious Future where struct page is just a
pointer and struct folio (et al) is allocated dynamically?
I think Willy mentioned that there might be ways to encode it in the 8-byte
for the "tail" pages.
Yes. For anon memory, the page->memdesc has a 4-bit 'type' and the
remaining 60 bits is a pointer to a struct folio (allocated from a slab
with 16 byte alignment). The current list of types [1] has file folios
as type 2 and anon folios as type 3. We could allocate a type to be
'anon exclusive', thus essentially giving us an anon-exclusive bit.
Right.
[1] https://kernelnewbies.org/MatthewWilcox/Memdescs
Don't get too excited about "we're almost out of types". The "managed"
type has subtypes. We could also collapse "file" and "anon" into a
single type and distinguish between them with a bit in the folio.
Anyway, yes, we can do one per-page flag. Two per-page flags starts to
get dicey.
hwpoison? :/
--
Cheers,
David / dhildenb