linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Glauber Costa <glommer@parallels.com>
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org,
	Tejun Heo <tj@kernel.org>, Michal Hocko <mhocko@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH v4 3/6] memcg: fast hierarchy-aware child test.
Date: Fri, 25 Jan 2013 15:59:01 -0800	[thread overview]
Message-ID: <20130125155901.4d3fb00c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1358862461-18046-4-git-send-email-glommer@parallels.com>

On Tue, 22 Jan 2013 17:47:38 +0400
Glauber Costa <glommer@parallels.com> wrote:

> Currently, we use cgroups' provided list of children to verify if it is
> safe to proceed with any value change that is dependent on the cgroup
> being empty.
> 
> This is less than ideal, because it enforces a dependency over cgroup
> core that we would be better off without. The solution proposed here is
> to iterate over the child cgroups and if any is found that is already
> online, we bounce and return: we don't really care how many children we
> have, only if we have any.
> 
> This is also made to be hierarchy aware. IOW, cgroups with  hierarchy
> disabled, while they still exist, will be considered for the purpose of
> this interface as having no children.

The code comments are a bit unclear.  Did this improve them?

--- a/mm/memcontrol.c~memcg-fast-hierarchy-aware-child-test-fix
+++ a/mm/memcontrol.c
@@ -4761,8 +4761,9 @@ static void mem_cgroup_reparent_charges(
 }
 
 /*
- * this mainly exists for tests during set of use_hierarchy. Since this is
- * the very setting we are changing, the current hierarchy value is meaningless
+ * This mainly exists for tests during the setting of set of use_hierarchy.
+ * Since this is the very setting we are changing, the current hierarchy value
+ * is meaningless
  */
 static inline bool __memcg_has_children(struct mem_cgroup *memcg)
 {
@@ -4775,11 +4776,11 @@ static inline bool __memcg_has_children(
 }
 
 /*
- * must be called with cgroup_lock held, unless the cgroup is guaranteed to be
- * already dead (like in mem_cgroup_force_empty, for instance).  This is
- * different than mem_cgroup_count_children, in the sense that we don't really
- * care how many children we have, we only need to know if we have any. It is
- * also count any memcg without hierarchy as infertile for that matter.
+ * Must be called with cgroup_lock held, unless the cgroup is guaranteed to be
+ * already dead (in mem_cgroup_force_empty(), for instance).  This is different
+ * from mem_cgroup_count_children(), in the sense that we don't really care how
+ * many children we have; we only need to know if we have any.  It also counts
+ * any memcg without hierarchy as infertile.
  */
 static inline bool memcg_has_children(struct mem_cgroup *memcg)
 {
_

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-01-25 23:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 13:47 [PATCH v4 0/6] replace cgroup_lock with memcg specific locking Glauber Costa
2013-01-22 13:47 ` [PATCH v4 1/6] memcg: prevent changes to move_charge_at_immigrate during task attach Glauber Costa
2013-01-29  0:11   ` Kamezawa Hiroyuki
2013-01-22 13:47 ` [PATCH v4 2/6] memcg: split part of memcg creation to css_online Glauber Costa
2013-01-25 23:52   ` Andrew Morton
2013-01-28  8:35     ` Lord Glauber Costa of Sealand
2013-01-29  0:12   ` Kamezawa Hiroyuki
2013-01-22 13:47 ` [PATCH v4 3/6] memcg: fast hierarchy-aware child test Glauber Costa
2013-01-25 23:59   ` Andrew Morton [this message]
2013-01-28  8:30     ` Lord Glauber Costa of Sealand
2013-01-29  0:14   ` Kamezawa Hiroyuki
2013-01-22 13:47 ` [PATCH v4 4/6] memcg: replace cgroup_lock with memcg specific memcg_lock Glauber Costa
2013-01-22 14:00   ` Michal Hocko
2013-01-29  0:16   ` Kamezawa Hiroyuki
2013-01-22 13:47 ` [PATCH v4 5/6] memcg: increment static branch right after limit set Glauber Costa
2013-01-29  0:18   ` Kamezawa Hiroyuki
2013-01-22 13:47 ` [PATCH v4 6/6] memcg: avoid dangling reference count in creation failure Glauber Costa
2013-01-22 14:00   ` Michal Hocko
2013-01-29  0:22   ` Kamezawa Hiroyuki
2013-01-25 10:05 ` [PATCH v4 0/6] replace cgroup_lock with memcg specific locking Lord Glauber Costa of Sealand
2013-01-25 10:18   ` Michal Hocko
2013-01-25 10:27     ` Lord Glauber Costa of Sealand
2013-01-25 17:37       ` Tejun Heo
2013-01-26  0:03         ` Andrew Morton

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=20130125155901.4d3fb00c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=glommer@parallels.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=tj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).