All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Chris Down <chris@chrisdown.name>,
	qiwuchen55@gmail.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH] mm/vmscan: fix incorrect return type for cgroup_reclaim()
Date: Fri, 20 Mar 2020 08:28:20 +0100	[thread overview]
Message-ID: <20200320072820.GA24409@dhcp22.suse.cz> (raw)
In-Reply-To: <20200319173606.GL22433@bombadil.infradead.org>

On Thu 19-03-20 10:36:06, Matthew Wilcox wrote:
> On Thu, Mar 19, 2020 at 04:20:25PM +0000, Chris Down wrote:
[...]
> > > -static bool cgroup_reclaim(struct scan_control *sc)
> > > +static struct mem_cgroup *cgroup_reclaim(struct scan_control *sc)
> > > {
> > > -	return false;
> > > +	return NULL;
> > > }
> 
> I think this is actually the important bit.  For those who build
> their kernels with cgroups disabled, it will save a small number of
> instructions since cgroup_reclaim() will be NULL rather than dereferencing
> sc->target_mem_group.  It'd be nice to have that saving quantified as
> part of the changelog.

I gave it a try and you are right that !MEMCG is slightly better. But
MEMCG=y which is a more common configuration I would say is worse
   text    data     bss     dec     hex filename
  40661   24060      12   64733    fcdd mm/vmscan.memcg.after.o
  40556   24060      12   64628    fc74 mm/vmscan.memcg.before.o
  36240   23076       8   59324    e7bc mm/vmscan.nomemcg.after.o
  36283   23076       8   59367    e7e7 mm/vmscan.nomemcg.before.o

This is with gcc version 9.2.1 20200306 (Debian 9.2.1-31).
-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2020-03-20  7:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 15:50 [PATCH] mm/vmscan: fix incorrect return type for cgroup_reclaim() qiwuchen55
2020-03-19 16:07 ` Michal Hocko
2020-03-20  7:34   ` Baoquan He
2020-03-19 16:20 ` Chris Down
2020-03-19 17:36   ` Matthew Wilcox
2020-03-20  2:29     ` chenqiwu
2020-03-20  7:28     ` Michal Hocko [this message]
2020-03-20  2:20   ` chenqiwu

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=20200320072820.GA24409@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chenqiwu@xiaomi.com \
    --cc=chris@chrisdown.name \
    --cc=linux-mm@kvack.org \
    --cc=qiwuchen55@gmail.com \
    --cc=willy@infradead.org \
    /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.