]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/memcontrol: fix seq_buf size to save memory when PAGE_SIZE is large
authorRyan Roberts <ryan.roberts@arm.com>
Mon, 21 Oct 2024 13:00:26 +0000 (14:00 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:23 +0000 (21:29 -0700)
commitc6b7aee9f6877481accd6581e06fcea43f1770d4
tree621982ac795adcddeac80803dd776842aaae6d84
parent5b9d4ed53ae30a2501978bddcc63adfa2668d51e
mm/memcontrol: fix seq_buf size to save memory when PAGE_SIZE is large

Previously the seq_buf used for accumulating the memory.stat output was
sized at PAGE_SIZE.  But the amount of output is invariant to PAGE_SIZE;
If 4K is enough on a 4K page system, then it should also be enough on a
64K page system, so we can save 60K on the static buffer used in
mem_cgroup_print_oom_meminfo().  Let's make it so.

This also has the beneficial side effect of removing a place in the code
that assumed PAGE_SIZE is a compile-time constant.  So this helps our
quest towards supporting boot-time page size selection.

Link: https://lkml.kernel.org/r/20241021130027.3615969-1-ryan.roberts@arm.com
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c