lkml.org 
[lkml]   [2012]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: vmscan: check mem cgroup over reclaimed
On Mon, Jan 23, 2012 at 08:30:42PM +0800, Hillf Danton wrote:
> On Mon, Jan 23, 2012 at 6:47 PM, Johannes Weiner <hannes@cmpxchg.org> wrote:
> > On Mon, Jan 23, 2012 at 09:55:07AM +0800, Hillf Danton wrote:
> >> To avoid reduction in performance of reclaimee, checking overreclaim is added
> >> after shrinking lru list, when pages are reclaimed from mem cgroup.
> >>
> >> If over reclaim occurs, shrinking remaining lru lists is skipped, and no more
> >> reclaim for reclaim/compaction.
> >>
> >> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> >> ---
> >>
> >> --- a/mm/vmscan.c     Mon Jan 23 00:23:10 2012
> >> +++ b/mm/vmscan.c     Mon Jan 23 09:57:20 2012
> >> @@ -2086,6 +2086,7 @@ static void shrink_mem_cgroup_zone(int p
> >>       unsigned long nr_reclaimed, nr_scanned;
> >>       unsigned long nr_to_reclaim = sc->nr_to_reclaim;
> >>       struct blk_plug plug;
> >> +     bool memcg_over_reclaimed = false;
> >>
> >>  restart:
> >>       nr_reclaimed = 0;
> >> @@ -2103,6 +2104,11 @@ restart:
> >>
> >>                               nr_reclaimed += shrink_list(lru, nr_to_scan,
> >>                                                           mz, sc, priority);
> >> +
> >> +                             memcg_over_reclaimed = !scanning_global_lru(mz)
> >> +                                     && (nr_reclaimed >= nr_to_reclaim);
> >> +                             if (memcg_over_reclaimed)
> >> +                                     goto out;
> >
> > Since this merge window, scanning_global_lru() is always false when
> > the memory controller is enabled, i.e. most common configurations and
> > distribution kernels.
> >
> > This will with quite likely have bad effects on zone balancing,
> > pressure balancing between anon/file lru etc, while you haven't shown
> > that any workloads actually benefit from this.
> >
> Hi Johannes
>
> Thanks for your comment, first.
>
> Impact on zone balance and lru-list balance is introduced actually, but I
> dont think the patch is totally responsible for the balance mentioned,
> because soft limit, embedded in mem cgroup, is setup by users according to
> whatever tastes they have.
>
> Though there is room for the patch to be fine tuned in this direction or that,
> over reclaim should not be neglected entirely, but be avoided as much as we
> could, or users are enforced to set up soft limit with much care not to mess
> up zone balance.

Overreclaim is absolutely horrible with soft limits, but I think there
are more direct reasons than checking nr_to_reclaim only after a full
zone scan, for example, soft limit reclaim is invoked on zones that
are totally fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-24 09:37    [W:0.067 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site