On Tue, Oct 29, 2013 at 07:21:59PM -0200, Marcelo Tosatti wrote: > > > Could add a warning to memory API: if memory region is larger than 1GB > > > and RAM is 1GB backed, and not properly aligned, warn. > > Perhaps it would be better do abort and ask user to fix configuration, > > and on hugepage allocation failure not fallback to malloc but abort and > > tell user amount of hugepages needed to run guest with hugepage backend. > > You want to back your guest with 1GB hugepages. You get 1 such page at a > time, worst case. > > You either > > 1) map the guest physical address space region (1GB sized) where > the hole is located with smaller page sizes, which must be 2MB, see *, > which requires the user to specify a different hugetlbfs mount path with > sufficient 2MB huge pages. > Why not really on THP to do the work?
> 2) move the pieces of memory which can't be 1GB mapped backed into > 1GB hugepages, and map the remaining 1GB-aligned regions to individual 1GB > pages. > > I am trying to avoid 1) as it complicates management (and fixes a bug). -- Gleb.