The patch titled Subject: fixup: mm: memcontrol: Unbreak memcontrol build when THP is disabled has been added to the -mm tree. Its filename is mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2.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: Chris Down <chris@xxxxxxxxxxxxxx> Subject: fixup: mm: memcontrol: Unbreak memcontrol build when THP is disabled This can be folded into "mm: memcontrol: Expose THP events on a per-memcg basis" (mm-memcontrol-expose-thp-events-on-a-per-memcg-basis.patch). kbuild points out that this patch can't be built with CONFIG_TRANSPARENT_HUGEPAGE not set. I had originally worried about this, but had only checked NR_ANON_THPS (which is not ifdeffed), not the event counters. NR_ANON_THPS is not #ifdeffed in node_stat_item, so we don't need to also guard MEMCG_RSS_HUGE to futureproof it. Link: http://lkml.kernel.org/r/20190131160802.GA5777@xxxxxxxxxxxxxx Signed-off-by: Chris Down <chris@xxxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Roman Gushchin <guro@xxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/Documentation/admin-guide/cgroup-v2.rst~mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2 +++ a/Documentation/admin-guide/cgroup-v2.rst @@ -1261,12 +1261,14 @@ PAGE_SIZE multiple when read back. thp_fault_alloc Number of transparent hugepages which were allocated to satisfy - a page fault, including COW faults + a page fault, including COW faults. This counter is not present + when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_collapse_alloc - Number of transparent hugepages which were allocated to - allow collapsing an existing range of pages + Number of transparent hugepages which were allocated to allow + collapsing an existing range of pages. This counter is not + present when CONFIG_TRANSPARENT_HUGEPAGE is not set. memory.swap.current A read-only single value file which exists on non-root --- a/mm/memcontrol.c~mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2 +++ a/mm/memcontrol.c @@ -5627,9 +5627,11 @@ static int memory_stat_show(struct seq_f seq_printf(m, "pglazyfree %lu\n", acc.events[PGLAZYFREE]); seq_printf(m, "pglazyfreed %lu\n", acc.events[PGLAZYFREED]); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE seq_printf(m, "thp_fault_alloc %lu\n", acc.events[THP_FAULT_ALLOC]); seq_printf(m, "thp_collapse_alloc %lu\n", acc.events[THP_COLLAPSE_ALLOC]); +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ return 0; } _ Patches currently in -mm which might be from chris@xxxxxxxxxxxxxx are mm-create-mem_cgroup_from_seq.patch mm-extract-memcg-maxable-seq_file-logic-to-seq_show_memcg_tunable.patch mm-proportional-memorylowmin-reclaim.patch mm-memcontrol-expose-thp-events-on-a-per-memcg-basis.patch mm-memcontrol-expose-thp-events-on-a-per-memcg-basis-fix-2.patch