Re: [PATCH] memcg: move do_memsw_account() to CONFIG_MEMCG_V1
From: Johannes Weiner
Date: Wed Mar 12 2025 - 19:02:15 EST
On Wed, Mar 12, 2025 at 03:25:52PM -0700, Shakeel Butt wrote:
> The do_memsw_account() is used to enable or disable legacy memory+swap
> accounting in memory cgroup. However with disabled CONFIG_MEMCG_V1, we
> don't need to keep checking it. So, let's always return false for
> !CONFIG_MEMCG_V1 configs.
>
> Before the patch:
>
> $ size mm/memcontrol.o
> text data bss dec hex filename
> 49928 10736 4172 64836 fd44 mm/memcontrol.o
>
> After the patch:
>
> $ size mm/memcontrol.o
> text data bss dec hex filename
> 49430 10480 4172 64082 fa52 mm/memcontrol.o
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Nice. It being a jump label avoids the branch, but it's still
unnecessary text and therefor i$ burden on fairly hot paths.
Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>