linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yanhai <zhu.yanhai@gmail.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 0/3] Implementation of cgroup isolation
Date: Tue, 29 Mar 2011 22:08:00 +0800	[thread overview]
Message-ID: <AANLkTikk97yR9j4iOHz=Ye0evhnAQkTodL+Df9E-+VeM@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimMLieDT2dePRvtUFDvasz1rk=ZgTdeei0BL9P5@mail.gmail.com>

2011/3/29 Zhu Yanhai <zhu.yanhai@gmail.com>:
> Hi,
>
> 2011/3/29 Michal Hocko <mhocko@suse.cz>:
>> Isn't this an overhead that would slow the whole thing down. Consider
>> that you would need to lookup page_cgroup for every page and touch
>> mem_cgroup to get the limit.
>
> Current almost has did such things, say the direct reclaim path:
> shrink_inactive_list()
>   ->isolate_pages_global()
>      ->isolate_lru_pages()
>         ->mem_cgroup_del_lru(for each page it wants to isolate)
>            and in mem_cgroup_del_lru() we have:
oops, the below code is from mem_cgroup_rotate_lru_list not
mem_cgroup_del_lru, the correct one should be:
[code]
pc = lookup_page_cgroup(page);
	/* can happen while we handle swapcache. */
	if (!TestClearPageCgroupAcctLRU(pc))
		return;
	VM_BUG_ON(!pc->mem_cgroup);
	/*
	 * We don't check PCG_USED bit. It's cleared when the "page" is finally
	 * removed from global LRU.
	 */
	mz = page_cgroup_zoneinfo(pc);
	MEM_CGROUP_ZSTAT(mz, lru) -= 1;
	if (mem_cgroup_is_root(pc->mem_cgroup))
		return;
[/code]
Anyway, the point still stands.

-zyh
> [code]
>        pc = lookup_page_cgroup(page);
>        /*
>         * Used bit is set without atomic ops but after smp_wmb().
>         * For making pc->mem_cgroup visible, insert smp_rmb() here.
>         */
>        smp_rmb();
>        /* unused or root page is not rotated. */
>        if (!PageCgroupUsed(pc) || mem_cgroup_is_root(pc->mem_cgroup))
>                return;
> [/code]
> By calling mem_cgroup_is_root(pc->mem_cgroup) we already brought the
> struct mem_cgroup into cache.
> So probably things won't get worse at least.
>
> Thanks,
> Zhu Yanhai
>
>> The point of the isolation is to not touch the global reclaim path at
>> all.
>>
>>> 3) shrink the cgroups who have set a reserve_limit, and leave them with only
>>> the reserve_limit bytes they need. if nr_reclaimed is meet, goto finish.
>>> 4) OOM
>>>
>>> Does it make sense?
>>
>> It sounds like a good thing - in that regard it is more generic than
>> a simple flag - but I am afraid that the implementation wouldn't be
>> that easy to preserve the performance and keep the balance between
>> groups. But maybe it can be done without too much cost.
>>
>> Thanks
>> --
>> Michal Hocko
>> SUSE Labs
>> SUSE LINUX s.r.o.
>> Lihovarska 1060/12
>> 190 00 Praha 9
>> Czech Republic
>>
>

--
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:[~2011-03-29 14:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  9:39 Michal Hocko
2011-03-28  9:39 ` [RFC 1/3] Add mem_cgroup->isolated and configuration knob Michal Hocko
2011-03-28  9:39 ` [RFC 2/3] Implement isolated LRU cgroups Michal Hocko
2011-03-28  9:40 ` [RFC 3/3] Do not shrink isolated groups from the global reclaim Michal Hocko
2011-03-28 11:03 ` [RFC 0/3] Implementation of cgroup isolation KAMEZAWA Hiroyuki
2011-03-28 11:44   ` Michal Hocko
2011-03-29  0:09     ` KAMEZAWA Hiroyuki
2011-03-29  7:32       ` Michal Hocko
2011-03-29  7:51         ` KAMEZAWA Hiroyuki
2011-03-29  8:59           ` Michal Hocko
2011-03-29  9:41             ` KAMEZAWA Hiroyuki
2011-03-29 11:18               ` Michal Hocko
2011-03-29 13:15                 ` Zhu Yanhai
2011-03-29 13:42                   ` Michal Hocko
2011-03-29 14:02                     ` Zhu Yanhai
2011-03-29 14:08                       ` Zhu Yanhai [this message]
2011-03-30  7:42                       ` Michal Hocko
2011-03-30  5:32               ` Ying Han
2011-03-29 15:53   ` Balbir Singh
2011-03-30  8:18     ` Michal Hocko
2011-03-30 17:59       ` Ying Han
2011-03-31  9:53         ` Michal Hocko
2011-03-31 18:10           ` Ying Han
2011-04-01 14:04             ` Michal Hocko
2011-03-31 10:01       ` Balbir Singh
2011-03-28 18:01 ` Ying Han
2011-03-29  0:12   ` KAMEZAWA Hiroyuki
2011-03-29  0:37     ` Ying Han
2011-03-29  0:47       ` KAMEZAWA Hiroyuki
2011-03-29  2:29         ` KAMEZAWA Hiroyuki
2011-03-29  3:02           ` Ying Han
2011-03-29  2:46         ` Ying Han
2011-03-29  2:45           ` KAMEZAWA Hiroyuki
2011-03-29  4:03             ` Ying Han
2011-03-29  7:53   ` Michal Hocko

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='AANLkTikk97yR9j4iOHz=Ye0evhnAQkTodL+Df9E-+VeM@mail.gmail.com' \
    --to=zhu.yanhai@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --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