linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Sha <handai.szj@gmail.com>
Cc: Ying Han <yinghan@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <bsingharora@gmail.com>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 2/2] mm: memcg: hierarchical soft limit reclaim
Date: Wed, 18 Jan 2012 10:25:09 +0100	[thread overview]
Message-ID: <20120118092509.GI24386@cmpxchg.org> (raw)
In-Reply-To: <CAFj3OHWY2Biw54gaGeH5fkxzgOhxn7NAibeYT_Jmga-_ypNSRg@mail.gmail.com>

On Wed, Jan 18, 2012 at 03:17:25PM +0800, Sha wrote:
> > > I don't think it solve the root of the problem, example:
> > > root
> > > -> A (hard limit 20G, soft limit 12G, usage 20G)
> > >   -> A1 ( soft limit 2G,   usage 1G)
> > >   -> A2 ( soft limit 10G, usage 19G)
> > >          ->B1 (soft limit 5G, usage 4G)
> > >          ->B2 (soft limit 5G, usage 15G)
> > >
> > > Now A is hitting its hard limit and start hierarchical reclaim under A.
> > > If we choose B1 to go through mem_cgroup_over_soft_limit, it will
> > > return true because its parent A2 has a large usage and will lead to
> > > priority=0 reclaiming. But in fact it should be B2 to be punished.
> 
> > Because A2 is over its soft limit, the whole hierarchy below it should
> > be preferred over A1, so both B1 and B2 should be soft limit reclaimed
> > to be consistent with behaviour at the root level.
> 
> Well it is just the behavior that I'm expecting actually. But with my
> humble comprehension, I can't catch the soft-limit-based hierarchical
> reclaiming under the target cgroup (A2) in the current implementation
> or after the patch. Both the current mem_cgroup_soft_reclaim or
> shrink_zone select victim sub-cgroup by mem_cgroup_iter, but it
> doesn't take soft limit into consideration, do I left anything ?

No, currently soft limits are ignored if pressure originates from
below root_mem_cgroup.

But iff soft limits are applied right now, they are applied
hierarchically, see mem_cgroup_soft_limit_reclaim().

In my opinion, the fact that soft limits are ignored when pressure is
triggered sub-root_mem_cgroup is an artifact of the per-zone tree, so
I allowed soft limits to be taken into account below root_mem_cgroup.

But IMO, this is something different from how soft limit reclaim is
applied once triggered: currently, soft limit reclaim applies to a
whole hierarchy, including all children.  And this I left unchanged.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-01-18  9:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 15:02 [patch 0/2] mm: memcg reclaim integration followups Johannes Weiner
2012-01-10 15:02 ` [patch 1/2] mm: memcg: per-memcg reclaim statistics Johannes Weiner
2012-01-10 23:54   ` Ying Han
2012-01-11  0:30     ` Johannes Weiner
2012-01-11 22:33       ` Ying Han
2012-01-12  9:17         ` Johannes Weiner
2012-01-10 15:02 ` [patch 2/2] mm: memcg: hierarchical soft limit reclaim Johannes Weiner
2012-01-11 21:42   ` Ying Han
2012-01-12  8:59     ` Johannes Weiner
2012-01-13 21:31       ` Ying Han
2012-01-13 22:44         ` Johannes Weiner
2012-01-17 14:22           ` Sha
2012-01-17 14:53             ` Johannes Weiner
2012-01-17 20:25               ` Ying Han
2012-01-17 21:56                 ` Johannes Weiner
2012-01-17 23:39                   ` Ying Han
2012-01-18  7:17               ` Sha
2012-01-18  9:25                 ` Johannes Weiner [this message]
2012-01-18 11:25                   ` Sha
2012-01-18 15:27                     ` Michal Hocko
2012-01-19  6:38                       ` Sha
2012-01-12  1:54   ` KAMEZAWA Hiroyuki
2012-01-13 12:16     ` Johannes Weiner
2012-01-18  5:26       ` KAMEZAWA Hiroyuki
2012-01-13 12:04   ` Michal Hocko
2012-01-13 15:50     ` Johannes Weiner
2012-01-13 16:34       ` Michal Hocko
2012-01-13 21:45         ` Ying Han
2012-01-18  9:45           ` Johannes Weiner
2012-01-18 20:38             ` Ying Han

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=20120118092509.GI24386@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=handai.szj@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=yinghan@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox