All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@parallels.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	linux-mm@kvack.org, devel@openvz.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC 1/4] memcg: provide root figures from system totals
Date: Tue, 2 Oct 2012 13:15:43 +0400	[thread overview]
Message-ID: <506AB0BF.9030400@parallels.com> (raw)
In-Reply-To: <20121001170046.GC24860@dhcp22.suse.cz>

On 10/01/2012 09:00 PM, Michal Hocko wrote:
> On Tue 25-09-12 12:52:50, Glauber Costa wrote:
>> > For the root memcg, there is no need to rely on the res_counters.
> This is true only if there are no children groups but once there is at
> least one we have to move global statistics into root res_counter and
> start using it since then. This is a tricky part because it has to be
> done atomically so that we do not miss anything.
> 
Why can't we shortcut it all the time?

It makes a lot of sense to use the root cgroup as the sum of everything,
IOW, global counters. Otherwise you are left in a situation where you
had global statistics, and all of a sudden, when a group is created, you
start having just a subset of that, excluding the tasks in root.

If we can always assume root will have the sum of *all* tasks, including
the ones in root, we should never need to rely on root res_counters.

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Glauber Costa <glommer@parallels.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: <linux-kernel@vger.kernel.org>, <cgroups@vger.kernel.org>,
	<linux-mm@kvack.org>, <devel@openvz.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC 1/4] memcg: provide root figures from system totals
Date: Tue, 2 Oct 2012 13:15:43 +0400	[thread overview]
Message-ID: <506AB0BF.9030400@parallels.com> (raw)
In-Reply-To: <20121001170046.GC24860@dhcp22.suse.cz>

On 10/01/2012 09:00 PM, Michal Hocko wrote:
> On Tue 25-09-12 12:52:50, Glauber Costa wrote:
>> > For the root memcg, there is no need to rely on the res_counters.
> This is true only if there are no children groups but once there is at
> least one we have to move global statistics into root res_counter and
> start using it since then. This is a tricky part because it has to be
> done atomically so that we do not miss anything.
> 
Why can't we shortcut it all the time?

It makes a lot of sense to use the root cgroup as the sum of everything,
IOW, global counters. Otherwise you are left in a situation where you
had global statistics, and all of a sudden, when a group is created, you
start having just a subset of that, excluding the tasks in root.

If we can always assume root will have the sum of *all* tasks, including
the ones in root, we should never need to rely on root res_counters.


  reply	other threads:[~2012-10-02  9:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25  8:52 [RFC 0/4] bypass charges if memcg is not used Glauber Costa
2012-09-25  8:52 ` Glauber Costa
     [not found] ` <1348563173-8952-1-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-25  8:52   ` [RFC 1/4] memcg: provide root figures from system totals Glauber Costa
2012-09-25  8:52     ` Glauber Costa
2012-09-25  8:52     ` Glauber Costa
     [not found]     ` <1348563173-8952-2-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-10-01 17:00       ` Michal Hocko
2012-10-01 17:00         ` Michal Hocko
2012-10-01 17:00         ` Michal Hocko
2012-10-02  9:15         ` Glauber Costa [this message]
2012-10-02  9:15           ` Glauber Costa
     [not found]           ` <506AB0BF.9030400-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-10-02  9:34             ` Michal Hocko
2012-10-02  9:34               ` Michal Hocko
2012-10-02  9:34               ` Michal Hocko
2012-09-25  8:52   ` [RFC 2/4] memcg: make it suck faster Glauber Costa
2012-09-25  8:52     ` Glauber Costa
2012-09-25  8:52     ` Glauber Costa
     [not found]     ` <1348563173-8952-3-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-25 21:02       ` Andrew Morton
2012-09-25 21:02         ` Andrew Morton
2012-09-25 21:02         ` Andrew Morton
2012-09-26  8:53         ` Glauber Costa
2012-09-26  8:53           ` Glauber Costa
2012-09-26  9:03           ` Daniel P. Berrange
2012-09-26  9:03             ` Daniel P. Berrange
2012-09-25  8:52   ` [RFC 3/4] memcg: do not call page_cgroup_init at system_boot Glauber Costa
2012-09-25  8:52     ` Glauber Costa
2012-09-25  8:52     ` Glauber Costa
2012-09-25  8:52   ` [RFC 4/4] memcg: do not walk all the way to the root for memcg Glauber Costa
2012-09-25  8:52     ` Glauber Costa
2012-09-25  8:52     ` Glauber Costa

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=506AB0BF.9030400@parallels.com \
    --to=glommer@parallels.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=devel@openvz.org \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.