mm: page_alloc: batch vmstat updates in expand()
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 27 Mar 2024 19:01:11 +0000 (15:01 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:05 +0000 (20:56 -0700)
commit883dd161e9a83e188487debc562b1928917a4b39
treebbe025ffd5ec026bb95bf84dc4ca96254dec4cfd
parente1f42a577f63647dadf1abe4583053c03d6be045
mm: page_alloc: batch vmstat updates in expand()

expand() currently updates vmstat for every subpage.  This is unnecessary,
since they're all of the same zone and migratetype.

Count added pages locally, then do a single vmstat update.

Link: https://lkml.kernel.org/r/20240327190111.GC7597@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c