Skip to content

Commit 0d648dd

Browse files
Baolin Wangakpm00
authored andcommitted
mm: drop the 'anon_' prefix for swap-out mTHP counters
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: d0f048a ("mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters") Fixes: 42248b9 ("mm: add docs for per-order mTHP counters and transhuge_page ABI") Signed-off-by: Baolin Wang <[email protected]> Suggested-by: "Huang, Ying" <[email protected]> Acked-by: Barry Song <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Lance Yang <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1613e60 commit 0d648dd

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Documentation/admin-guide/mm/transhuge.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,11 @@ anon_fault_fallback_charge
467467
instead falls back to using huge pages with lower orders or
468468
small pages even though the allocation was successful.
469469

470-
anon_swpout
470+
swpout
471471
is incremented every time a huge page is swapped out in one
472472
piece without splitting.
473473

474-
anon_swpout_fallback
474+
swpout_fallback
475475
is incremented if a huge page has to be split before swapout.
476476
Usually because failed to allocate some continuous swap space
477477
for the huge page.

include/linux/huge_mm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ enum mthp_stat_item {
269269
MTHP_STAT_ANON_FAULT_ALLOC,
270270
MTHP_STAT_ANON_FAULT_FALLBACK,
271271
MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE,
272-
MTHP_STAT_ANON_SWPOUT,
273-
MTHP_STAT_ANON_SWPOUT_FALLBACK,
272+
MTHP_STAT_SWPOUT,
273+
MTHP_STAT_SWPOUT_FALLBACK,
274274
__MTHP_STAT_COUNT
275275
};
276276

mm/huge_memory.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,15 @@ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
558558
DEFINE_MTHP_STAT_ATTR(anon_fault_alloc, MTHP_STAT_ANON_FAULT_ALLOC);
559559
DEFINE_MTHP_STAT_ATTR(anon_fault_fallback, MTHP_STAT_ANON_FAULT_FALLBACK);
560560
DEFINE_MTHP_STAT_ATTR(anon_fault_fallback_charge, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE);
561-
DEFINE_MTHP_STAT_ATTR(anon_swpout, MTHP_STAT_ANON_SWPOUT);
562-
DEFINE_MTHP_STAT_ATTR(anon_swpout_fallback, MTHP_STAT_ANON_SWPOUT_FALLBACK);
561+
DEFINE_MTHP_STAT_ATTR(swpout, MTHP_STAT_SWPOUT);
562+
DEFINE_MTHP_STAT_ATTR(swpout_fallback, MTHP_STAT_SWPOUT_FALLBACK);
563563

564564
static struct attribute *stats_attrs[] = {
565565
&anon_fault_alloc_attr.attr,
566566
&anon_fault_fallback_attr.attr,
567567
&anon_fault_fallback_charge_attr.attr,
568-
&anon_swpout_attr.attr,
569-
&anon_swpout_fallback_attr.attr,
568+
&swpout_attr.attr,
569+
&swpout_fallback_attr.attr,
570570
NULL,
571571
};
572572

mm/page_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static inline void count_swpout_vm_event(struct folio *folio)
217217
count_memcg_folio_events(folio, THP_SWPOUT, 1);
218218
count_vm_event(THP_SWPOUT);
219219
}
220-
count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT);
220+
count_mthp_stat(folio_order(folio), MTHP_STAT_SWPOUT);
221221
#endif
222222
count_vm_events(PSWPOUT, folio_nr_pages(folio));
223223
}

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
12271227
THP_SWPOUT_FALLBACK, 1);
12281228
count_vm_event(THP_SWPOUT_FALLBACK);
12291229
}
1230-
count_mthp_stat(order, MTHP_STAT_ANON_SWPOUT_FALLBACK);
1230+
count_mthp_stat(order, MTHP_STAT_SWPOUT_FALLBACK);
12311231
#endif
12321232
if (!add_to_swap(folio))
12331233
goto activate_locked_split;

0 commit comments

Comments
 (0)