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, Mar 19, 2020 at 10:36:06AM -0700, Matthew Wilcox wrote:
> On Thu, Mar 19, 2020 at 04:20:25PM +0000, Chris Down wrote:
> 
> 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 agree.

> 
> > > @@ -2625,7 +2626,7 @@ static inline bool should_continue_reclaim(struct pglist_data *pgdat,
> > > 
> > > static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
> > > {
> > > -	struct mem_cgroup *target_memcg = sc->target_mem_cgroup;
> > > +	struct mem_cgroup *target_memcg = cgroup_reclaim(sc);
> 
> It feels like the name is wrong, doesn't it?  cgroup_reclaim() doesn't
> really scream to me "I return a mem_cgroup pointer".  I can't think of
> a good name, but maybe someone else can.
> 

I can't think of a good name, too. Maybe we just keep it unchanged if
nobody else can.




[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