From: Jeff Liu <jeff.liu@oracle.com>
To: Lord Glauber Costa of Sealand <glommer@parallels.com>
Cc: linux-mm@kvack.org, Michal Hocko <mhocko@suse.cz>, handai.szj@taobao.com
Subject: Re: [PATCH v2 2/6] memcg: bypass swap accounting for the root memcg
Date: Thu, 31 Jan 2013 14:18:57 +0800 [thread overview]
Message-ID: <510A0CD1.5090403@oracle.com> (raw)
In-Reply-To: <5107A211.50409@parallels.com>
Hi Glauber,
Sorry for my late response!
On 01/29/2013 06:18 PM, Lord Glauber Costa of Sealand wrote:
> On 01/28/2013 02:54 PM, Jeff Liu wrote:
>> Root memcg with swap cgroup is special since we only do tracking but can
>> not set limits against it. In order to facilitate the implementation of
>> the coming swap cgroup structures delay allocation mechanism, we can bypass
>> the default swap statistics upon the root memcg and figure it out through
>> the global stats instead as below:
>>
> I am sorry if this is was already discussed before, but:
>> root_memcg_swap_stat: total_swap_pages - nr_swap_pages - used_swap_pages_of_all_memcgs
>> memcg_total_swap_stats: root_memcg_swap_stat + other_memcg_swap_stats
>>
>
> Shouldn't it *at least* be dependent on use_hierarchy?
Yeah, actually use_hierarchy only affects the total swap numbers. While
computing memcg_total_swap_stats, it's original
for_each_mem_cgroup_tree() way already handle the stuff about hierarchy
and here we do not change its behavior. What we do is adding the root's
local swap stat to total (since the root statistics are not accounting
anymore, the per cpu data is ZERO).
>
> I don't see why root_memcg won't be always total_swap_pages -
> nr_swap_pages, since the root memcg is always viewed as a superset of
> the others, AFAIR.
>
> Even if it is not the general case (which again, I really believe it
> is), it certainly is the case for hierarchy enabled setups.
I'm also confused a little by hierarchy recently especially the
corresponding behavior of root is different... But we may have to do
some modification just based on the current implementation as the plan
of getting rid of hierarchy is slow as Michal mentioned.
>
> Also, I truly don't understand what is the business of
> root_memcg_swap_stat in non-root memcgs.
root_memcg_swap_stat represents swap numbers belonging to the root mem
cgroup. As its stats is 0 now, we need to fake it by the help of other
memcgs, that is: global_used_swap - swaps_used_by_other_memcgs(non-root
memcgs).
Thanks,
-Jeff
--
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>
next prev parent reply other threads:[~2013-01-31 6:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-28 10:54 [PATCH v2 0/6] memcg: disable swap cgroup allocation at swapon Jeff Liu
2013-01-28 10:54 ` [PATCH v2 1/6] memcg: refactor swap_cgroup_swapon() Jeff Liu
2013-01-29 9:15 ` Lord Glauber Costa of Sealand
2013-01-29 13:41 ` Michal Hocko
2013-01-28 10:54 ` [PATCH v2 2/6] memcg: bypass swap accounting for the root memcg Jeff Liu
2013-01-29 10:18 ` Lord Glauber Costa of Sealand
2013-01-31 6:18 ` Jeff Liu [this message]
2013-01-29 14:13 ` Michal Hocko
2013-01-30 16:01 ` Jeff Liu
2013-01-30 16:29 ` Michal Hocko
2013-01-31 4:00 ` Jeff Liu
2013-01-28 10:54 ` [PATCH v2 3/6] memcg: introduce memsw_accounting_users Jeff Liu
2013-01-29 9:46 ` Lord Glauber Costa of Sealand
2013-01-29 10:52 ` Jeff Liu
2013-01-29 14:26 ` Michal Hocko
2013-01-29 14:24 ` Michal Hocko
2013-01-29 15:16 ` Jeff Liu
2013-01-28 10:54 ` [PATCH v2 4/6] memcg: export nr_swap_files Jeff Liu
2013-01-29 9:47 ` Lord Glauber Costa of Sealand
2013-01-29 14:31 ` Michal Hocko
2013-01-29 15:17 ` Jeff Liu
2013-01-28 10:54 ` [PATCH v2 5/6] memcg: introduce swap_cgroup_init()/swap_cgroup_free() Jeff Liu
2013-01-29 9:57 ` Lord Glauber Costa of Sealand
2013-01-29 10:21 ` Jeff Liu
2013-01-29 14:56 ` Michal Hocko
2013-01-29 15:51 ` Jeff Liu
2013-01-29 16:09 ` Michal Hocko
2013-01-28 10:54 ` [PATCH v2 6/6] memcg: init/free swap cgroup strucutres upon create/free child memcg Jeff Liu
2013-01-29 9:59 ` Lord Glauber Costa of Sealand
2013-01-29 10:27 ` Jeff Liu
2013-01-29 15:11 ` Michal Hocko
2013-01-29 15:15 ` [PATCH v2 0/6] memcg: disable swap cgroup allocation at swapon Michal Hocko
2013-01-29 16:50 ` Jeff Liu
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=510A0CD1.5090403@oracle.com \
--to=jeff.liu@oracle.com \
--cc=glommer@parallels.com \
--cc=handai.szj@taobao.com \
--cc=linux-mm@kvack.org \
--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 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).