On Wed, 20 Jul 2022, Zach O'Keefe wrote: > Minimally, node_load[] entries just need to be able to hold the maximum > value of HPAGE_PMD_NR, which is compile-time defined per-arch based on > PMD_SHIFT and PAGE_SHIFT. node_load[] is only written either via memset(), > or with via post-increment. struct collapse_control may be allocated > via kmalloc() in other collapse contexts, and MAX_NUMNODES may be > arbitrarily large. #define the underlying type of node_load[] based off > HPAGE_PMD_NR to avoid excessive memory allocated for this struct. > > Fixes: 3b07f3bb225a ("mm/khugepaged: add struct collapse_control") > Link: https://lore.kernel.org/linux-mm/Ys2CeIm%2FQmQwWh9a@xxxxxxxxxx/ > Signed-off-by: Zach O'Keefe <zokeefe@xxxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx>