]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: swap_cgroup: allocate swap_cgroup map using vcalloc()
authorRoman Gushchin <roman.gushchin@linux.dev>
Fri, 15 Nov 2024 19:02:28 +0000 (19:02 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 14 Jan 2025 06:40:40 +0000 (22:40 -0800)
commit8eb92ed254e5353f38e4a664dc5fa70c8ec95d1a
tree97dae1aa1f22de0a18c9408a5efd9e7da2a07d3c
parent3472f639c692b28e7de345e90519430ad6ce2362
mm: swap_cgroup: allocate swap_cgroup map using vcalloc()

Currently swap_cgroup's map is constructed as a vmalloc()'s-based array of
pointers to individual struct pages.  This brings an unnecessary
complexity into the code.

This patch turns the swap_cgroup's map into a single space
allocated by vcalloc().

[akpm@linux-foundation.org: s/vfree/kvfree/, per Shakeel]
Link: https://lkml.kernel.org/r/20241115190229.676440-1-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap_cgroup.c