Re: [PATCH] mm/vmscan: fix incorrect return type for cgroup_reclaim()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux