The patch titled Subject: mm: migrate: drop redundant anonymous statistics for file folios migration has been added to the -mm mm-unstable branch. Its filename is mm-migrate-drop-redundant-anonymous-statistics-for-file-folios-migration.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-migrate-drop-redundant-anonymous-statistics-for-file-folios-migration.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Subject: mm: migrate: drop redundant anonymous statistics for file folios migration Date: Thu, 5 Dec 2024 11:53:48 +0800 Commit 5d65c8d758f2 ("mm: count the number of anonymous THPs per size") adds a new anonymous counter per THP size, however, when folio_mapping() is not NULL during folio migration, it means this is not an anonymous folio, so remove the redundant anonymous statistics in this case. Link: https://lkml.kernel.org/r/d5e191ae02c2ab63c70cdf44877fe14fc69f5ae8.1733368611.git.baolin.wang@xxxxxxxxxxxxxxxxx Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 2 -- 1 file changed, 2 deletions(-) --- a/mm/migrate.c~mm-migrate-drop-redundant-anonymous-statistics-for-file-folios-migration +++ a/mm/migrate.c @@ -523,8 +523,6 @@ static int __folio_migrate_mapping(struc */ newfolio->index = folio->index; newfolio->mapping = folio->mapping; - if (folio_test_anon(folio) && folio_test_large(folio)) - mod_mthp_stat(folio_order(folio), MTHP_STAT_NR_ANON, 1); folio_ref_add(newfolio, nr); /* add cache reference */ if (folio_test_swapbacked(folio)) { __folio_set_swapbacked(newfolio); _ Patches currently in -mm which might be from baolin.wang@xxxxxxxxxxxxxxxxx are mm-factor-out-the-order-calculation-into-a-new-helper.patch mm-shmem-change-shmem_huge_global_enabled-to-return-huge-order-bitmap.patch mm-shmem-add-large-folio-support-for-tmpfs.patch mm-shmem-add-a-kernel-command-line-to-change-the-default-huge-policy-for-tmpfs.patch docs-tmpfs-drop-fadvise-from-the-documentation.patch mm-migrate-drop-redundant-anonymous-statistics-for-file-folios-migration.patch