[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 12 Dec 2009 15:11:33 +0200
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: nishimura@....nes.nec.co.jp
Cc: containers@...ts.linux-foundation.org, linux-mm@...ck.org,
Paul Menage <menage@...gle.com>,
Li Zefan <lizf@...fujitsu.com>,
Andrew Morton <akpm@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Pavel Emelyanov <xemul@...nvz.org>,
Dan Malek <dan@...eddedalley.com>,
Vladislav Buzov <vbuzov@...eddedalley.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC v2 4/4] memcg: implement memory thresholds
On Sat, Dec 12, 2009 at 5:19 AM, Daisuke Nishimura
<d-nishimura@....biglobe.ne.jp> wrote:
>> @@ -56,6 +61,7 @@ static int really_do_swap_account __initdata = 1; /* for remember boot option*/
>>
>> static DEFINE_MUTEX(memcg_tasklist); /* can be hold under cgroup_mutex */
> This mutex has already removed in current mmotm.
> Please write a patch for memcg based on mmot.
Ok.
>
>> #define SOFTLIMIT_EVENTS_THRESH (1000)
>> +#define THRESHOLDS_EVENTS_THRESH (100)
>>
>> /*
>> * Statistics for memory cgroup.
>
> (snip)
>
>> @@ -1363,6 +1395,11 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
>> if (mem_cgroup_soft_limit_check(mem))
>> mem_cgroup_update_tree(mem, page);
>> done:
>> + if (mem_cgroup_threshold_check(mem)) {
>> + mem_cgroup_threshold(mem, false);
>> + if (do_swap_account)
>> + mem_cgroup_threshold(mem, true);
>> + }
>> return 0;
>> nomem:
>> css_put(&mem->css);
>> @@ -1906,6 +1943,11 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
>>
>> if (mem_cgroup_soft_limit_check(mem))
>> mem_cgroup_update_tree(mem, page);
>> + if (mem_cgroup_threshold_check(mem)) {
>> + mem_cgroup_threshold(mem, false);
>> + if (do_swap_account)
>> + mem_cgroup_threshold(mem, true);
>> + }
>> /* at swapout, this memcg will be accessed to record to swap */
>> if (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT)
>> css_put(&mem->css);
> Can "if (do_swap_account)" check be moved into mem_cgroup_threshold ?
Ok, I'll move it. It will affect performance of
mem_cgroup_invalidate_thresholds(),
but I don't think that it's important.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists