]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mm: drop the 'anon_' prefix for swap-out mTHP counters
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Thu, 23 May 2024 02:36:39 +0000 (10:36 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Jun 2024 02:19:23 +0000 (19:19 -0700)
The mTHP swap related counters: 'anon_swpout' and 'anon_swpout_fallback'
are confusing with an 'anon_' prefix, since the shmem can swap out
non-anonymous pages.  So drop the 'anon_' prefix to keep consistent with
the old swap counter names.

This is needed in 6.10-rcX to avoid having an inconsistent ABI out in the
field.

Link: https://lkml.kernel.org/r/7a8989c13299920d7589007a30065c3e2c19f0e0.1716431702.git.baolin.wang@linux.alibaba.com
Fixes: d0f048ac39f6 ("mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters")
Fixes: 42248b9d34ea ("mm: add docs for per-order mTHP counters and transhuge_page ABI")
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Suggested-by: "Huang, Ying" <ying.huang@intel.com>
Acked-by: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Lance Yang <ioworker0@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/admin-guide/mm/transhuge.rst
include/linux/huge_mm.h
mm/huge_memory.c
mm/page_io.c
mm/vmscan.c

index 076443cc10a6c779d9d6190bd1a289e89cee6f0b..d414d3f5592a8fad42822a2f5d0758f83e67e76e 100644 (file)
@@ -467,11 +467,11 @@ anon_fault_fallback_charge
        instead falls back to using huge pages with lower orders or
        small pages even though the allocation was successful.
 
-anon_swpout
+swpout
        is incremented every time a huge page is swapped out in one
        piece without splitting.
 
-anon_swpout_fallback
+swpout_fallback
        is incremented if a huge page has to be split before swapout.
        Usually because failed to allocate some continuous swap space
        for the huge page.
index c8d3ec116e291ba432b4b5a58a664b791712de09..8c72d37865838222a8d6b954a6546de9f65300c3 100644 (file)
@@ -269,8 +269,8 @@ enum mthp_stat_item {
        MTHP_STAT_ANON_FAULT_ALLOC,
        MTHP_STAT_ANON_FAULT_FALLBACK,
        MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE,
-       MTHP_STAT_ANON_SWPOUT,
-       MTHP_STAT_ANON_SWPOUT_FALLBACK,
+       MTHP_STAT_SWPOUT,
+       MTHP_STAT_SWPOUT_FALLBACK,
        __MTHP_STAT_COUNT
 };
 
index 317de2afd37181eb81bda4c9815213039a8c5586..89932fd0f62e866a70fde4037fcd5151877f3df8 100644 (file)
@@ -558,15 +558,15 @@ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
 DEFINE_MTHP_STAT_ATTR(anon_fault_alloc, MTHP_STAT_ANON_FAULT_ALLOC);
 DEFINE_MTHP_STAT_ATTR(anon_fault_fallback, MTHP_STAT_ANON_FAULT_FALLBACK);
 DEFINE_MTHP_STAT_ATTR(anon_fault_fallback_charge, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE);
-DEFINE_MTHP_STAT_ATTR(anon_swpout, MTHP_STAT_ANON_SWPOUT);
-DEFINE_MTHP_STAT_ATTR(anon_swpout_fallback, MTHP_STAT_ANON_SWPOUT_FALLBACK);
+DEFINE_MTHP_STAT_ATTR(swpout, MTHP_STAT_SWPOUT);
+DEFINE_MTHP_STAT_ATTR(swpout_fallback, MTHP_STAT_SWPOUT_FALLBACK);
 
 static struct attribute *stats_attrs[] = {
        &anon_fault_alloc_attr.attr,
        &anon_fault_fallback_attr.attr,
        &anon_fault_fallback_charge_attr.attr,
-       &anon_swpout_attr.attr,
-       &anon_swpout_fallback_attr.attr,
+       &swpout_attr.attr,
+       &swpout_fallback_attr.attr,
        NULL,
 };
 
index 46c603dddf043d4b5c0380996d3a5fb842d73315..0a150c240bf4fd919b65ab38b4626edf1efd5fe8 100644 (file)
@@ -217,7 +217,7 @@ static inline void count_swpout_vm_event(struct folio *folio)
                count_memcg_folio_events(folio, THP_SWPOUT, 1);
                count_vm_event(THP_SWPOUT);
        }
-       count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT);
+       count_mthp_stat(folio_order(folio), MTHP_STAT_SWPOUT);
 #endif
        count_vm_events(PSWPOUT, folio_nr_pages(folio));
 }
index d55e8d07ffc4a75e68e587ec9e22dc802cf67d24..2e34de9cd0d4f7c9f4ae754d699d414a1a054f4d 100644 (file)
@@ -1227,7 +1227,7 @@ retry:
                                                        THP_SWPOUT_FALLBACK, 1);
                                                count_vm_event(THP_SWPOUT_FALLBACK);
                                        }
-                                       count_mthp_stat(order, MTHP_STAT_ANON_SWPOUT_FALLBACK);
+                                       count_mthp_stat(order, MTHP_STAT_SWPOUT_FALLBACK);
 #endif
                                        if (!add_to_swap(folio))
                                                goto activate_locked_split;