Re: [PATCH] mm: memcontrol: move memsw charge callbacks to v1

Roman Gushchin
2025-01-25T01:25:51Z

On Fri, Jan 24, 2025 at 12:41:32AM -0500, Johannes Weiner wrote:
> The interweaving of two entirely different swap accounting strategies
> has been one of the more confusing parts of the memcg code. Split out
> the v1 code to clarify the implementation and a handful of callsites,
> and to avoid building the v1 bits when !CONFIG_MEMCG_V1.
>
> text data bss dec hex filename
> 39253 6446 4160 49859 c2c3 mm/memcontrol.o.old
> 38877 6382 4160 49419 c10b mm/memcontrol.o

Nice!

>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> include/linux/memcontrol.h | 17 +++--
> include/linux/swap.h | 5 --
> mm/huge_memory.c | 2 +-
> mm/memcontrol-v1.c | 89 ++++++++++++++++++++++++-
> mm/memcontrol-v1.h | 6 +-
> mm/memcontrol.c | 129 ++++++-------------------------------

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks