> Shouldn't we prefer still "mapped" pages when allocating? Thus, keep > the freepages list "sorted"?
Possibly. I can look at it in a followup if you want. I would prefer to not complicate this patch too much. > > With the new params to call release_pages less, how does this > interact with using MADV_DONTNEED? The only reason to delay > MADV_DONTNEED is to avoid splitting huge-pages? Which would > mean that we should rather be better at controlling where we allocate > from from the free-list? I first had a patch that tried to cluster inside the freelist with multiple passes (and only free aligned quire clusters first), but it ran into various problems, so I chose this simpler approach. With MADV_DONTNEED the param is not really needed I think, I mainly added the param for the benefit of hosts that don't have MADV_DONTNEED to let them not suffer from fragmentation too much. It would be possible to set the thresholds all to 0 if MADV_DONTNEED is available. -Andi