The patch titled Subject: mm/vmalloc: make show_numa_info() aware of hugepage mappings has been added to the -mm tree. Its filename is mm-vmalloc-make-show_numa_info-aware-of-hugepage-mappings.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-vmalloc-make-show_numa_info-aware-of-hugepage-mappings.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-vmalloc-make-show_numa_info-aware-of-hugepage-mappings.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Eric Dumazet <edumazet@xxxxxxxxxx> Subject: mm/vmalloc: make show_numa_info() aware of hugepage mappings show_numa_info() can be slightly faster, by skipping over hugepages directly. Link: https://lkml.kernel.org/r/20211001172725.105824-1-eric.dumazet@xxxxxxxxx Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx> Cc: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/vmalloc.c~mm-vmalloc-make-show_numa_info-aware-of-hugepage-mappings +++ a/mm/vmalloc.c @@ -3880,6 +3880,7 @@ static void show_numa_info(struct seq_fi { if (IS_ENABLED(CONFIG_NUMA)) { unsigned int nr, *counters = m->private; + unsigned int step = 1U << vm_area_page_order(v); if (!counters) return; @@ -3891,9 +3892,8 @@ static void show_numa_info(struct seq_fi memset(counters, 0, nr_node_ids * sizeof(unsigned int)); - for (nr = 0; nr < v->nr_pages; nr++) - counters[page_to_nid(v->pages[nr])]++; - + for (nr = 0; nr < v->nr_pages; nr += step) + counters[page_to_nid(v->pages[nr])] += step; for_each_node_state(nr, N_HIGH_MEMORY) if (counters[nr]) seq_printf(m, " N%u=%u", nr, counters[nr]); _ Patches currently in -mm which might be from edumazet@xxxxxxxxxx are mm-mempolicy-do-not-allow-illegal-mpol_f_numa_balancing-mpol_local-in-mbind.patch mm-vmalloc-make-show_numa_info-aware-of-hugepage-mappings.patch mm-large-system-hash-avoid-possible-null-deref-in-alloc_large_system_hash.patch mm-do-not-acquire-zone-lock-in-is_free_buddy_page.patch