lkml.org 
[lkml]   [2013]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch v3 -mm 1/3] memcg: integrate soft reclaim tighter with zone shrinking code
On Thu 16-05-13 15:12:00, Tejun Heo wrote:
> Sorry about the delay. Just getting back to memcg.
>
> On Mon, May 13, 2013 at 09:46:10AM +0200, Michal Hocko wrote:
> ...
> > during the first pass. Only groups which are over their soft limit or
> > any of their parents up the hierarchy is over the limit are considered
>
> ancestors?

Well, ancestors might or might not be part of the hierarchy, so while it
is much shorter I consider the original more precise.

> > +static void shrink_zone(struct zone *zone, struct scan_control *sc)
> > +{
> > + bool do_soft_reclaim = mem_cgroup_should_soft_reclaim(sc);
> > + unsigned long nr_scanned = sc->nr_scanned;
> > +
> > + __shrink_zone(zone, sc, do_soft_reclaim);
> > +
> > + /*
> > + * No group is over the soft limit or those that are do not have
> > + * pages in the zone we are reclaiming so we have to reclaim everybody
> > + */
> > + if (do_soft_reclaim && (sc->nr_scanned == nr_scanned)) {
> > + __shrink_zone(zone, sc, false);
> > + return;
> > + }
> > +}
>
> Maybe the following is easier to follow?
>
> if (mem_cgroup_should_soft_reclaim(sc)) {
> __shrink_zone(zone, sc, true);
> if (sc->nr_scanned == nr_scanned)
> __shrink_zone(zone, sc, false);
> } else {
> __shrink_zone(zone, sc, false);
> }
>
> But it's a minor point, please feel free to ignore.

I will stick with the original code as I have some plans to build on top
of that.

> Reviewed-by: Tejun Heo <tj@kernel.org>

Thank you!

>
> Thanks.
>
> --
> tejun

--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2013-05-17 10:01    [W:2.833 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site