All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Muchun Song <muchun.song@linux.dev>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Meta kernel team <kernel-team@meta.com>
Subject: Re: [PATCH] memcg: move do_memsw_account() to CONFIG_MEMCG_V1
Date: Wed, 12 Mar 2025 19:01:14 -0400	[thread overview]
Message-ID: <20250312230114.GA1247787@cmpxchg.org> (raw)
In-Reply-To: <20250312222552.3284173-1-shakeel.butt@linux.dev>

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@linux.dev>

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@cmpxchg.org>

  reply	other threads:[~2025-03-12 23:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 22:25 [PATCH] memcg: move do_memsw_account() to CONFIG_MEMCG_V1 Shakeel Butt
2025-03-12 23:01 ` Johannes Weiner [this message]
2025-03-13  7:33 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250312230114.GA1247787@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.