]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/rmap: do __folio_mod_stat() in __folio_add_rmap()
authorWei Yang <richard.weiyang@gmail.com>
Mon, 4 Aug 2025 06:41:06 +0000 (06:41 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:54:47 +0000 (16:54 -0700)
commit878d9e8cebbb111a678e1f83d7daee917922f700
treed3d7c3b9e0b6350369404ca96f385d9d911bacc4
parent9863124e0bfb94a0c1e84186d2f56f400b2e0112
mm/rmap: do __folio_mod_stat() in __folio_add_rmap()

It is required to modify folio statistic after rmap changes, so it looks
reasonable to do it in __folio_add_rmap(), which is the current behavior
of __folio_remove_rmap() and folio_add_new_anon_rmap().

Call __folio_mod_stat() in __folio_add_rmap(), so that rmap adjustment
family shares the same pattern.

Link: https://lkml.kernel.org/r/20250804064106.21269-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/rmap.c