On Fri, Apr 14, 2023 at 05:06:49PM +0100, Ryan Roberts wrote: > The point I'm thinking about is for 4K pages, we need to allocate 64K blocks to > use the contig bit. Roughly I guess that means going from average of 2K wastage > per anon VMA to 32K. Perhaps you can get away with that for a decent perf uplift. > > But for 64K pages, we need to allocate 2M blocks to use the contig bit. So that > takes average wastage from 32K to 1M. That feels a bit harder to justify. > Perhaps here, we should make a decision based on MADV_HUGEPAGE? > > So perhaps we actually want 2 values: one for if MADV_HUGEPAGE is not set on the > VMA, and one if it is? (with 64K pages I'm guessing there are many cases where > we won't PMD-map THPs - its 512MB). I'm kind of hoping that all this work takes away the benefit from CONFIG_PAGE_SIZE_64K, and we can just use 4k pages everywhere.