Folio Restructuring for Huge Pages in guest_memfd
summary
Adds HugeTLB and THP support to guest_memfd by making folio restructuring (split/merge) orthogonal to THP and HugeTLB, using existing helpers like folio_split() and considering xas_split_alloc() limits for large orders. Implements per-page tracking by splitting down from 1G to PMD then to pages using a logarithmic split (reduces 262,144 allocations to ~19 steps), preserves HVO optimization, removes host mappings on share→private, and merges folios in place so the original allocator can reclaim the folio intact.
AI-written summary · about
