[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-10 Thread Daisuke Nishimura
Hi. Balbir Singh wrote: Daisuke Nishimura wrote: Basic idea of my implementation: - what will be charged ? the number of swap entries. - when to charge/uncharge ? charge at get_swap_entry(), and uncharge at swap_entry_free(). You mean get_swap_page(), I suppose. The

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-10 Thread Daisuke Nishimura
Hi. [EMAIL PROTECTED] wrote: At first look, remembering mm struct is not very good. Remembering swap controller itself is better. The swap_cgroup when the page(and page_cgroup) is allocated and the swap_cgroup when the page is going to be swapped out may be different by

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-10 Thread Daisuke Nishimura
Hi. At first look, remembering mm struct is not very good. Remembering swap controller itself is better. The swap_cgroup when the page(and page_cgroup) is allocated and the swap_cgroup when the page is going to be swapped out may be different by swap_cgroup_move_task(), so I think swap_cgroup

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-10 Thread Daisuke Nishimura
Hi. Paul Menage wrote: + pc = page_get_page_cgroup(page); + if (WARN_ON(!pc)) + mm = init_mm; + else + mm = pc-pc_mm; + BUG_ON(!mm); Is this safe against races with the mem.force_empty operation? I've not considered yet about

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-10 Thread Daisuke Nishimura
Hi. @@ -664,6 +665,10 @@ retry: pc-flags = PAGE_CGROUP_FLAG_ACTIVE; if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE) pc-flags |= PAGE_CGROUP_FLAG_CACHE; +#ifdef CONFIG_CGROUP_SWAP_LIMIT +atomic_inc(mm-mm_count); +pc-pc_mm = mm; +#endif What kernel is this patch

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-06 Thread Pavel Emelyanov
KAMEZAWA Hiroyuki wrote: On Wed, 05 Mar 2008 17:14:12 +0300 Pavel Emelyanov [EMAIL PROTECTED] wrote: Strongly agree. Nobody's interested in swap as such: it's just secondary memory, where RAM is primary memory. People want to control memory as the sum of the two; and I expect they may also

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-06 Thread Pavel Emelyanov
KAMEZAWA Hiroyuki wrote: On Thu, 06 Mar 2008 11:20:17 +0300 Pavel Emelyanov [EMAIL PROTECTED] wrote: KAMEZAWA Hiroyuki wrote: On Wed, 05 Mar 2008 17:14:12 +0300 Pavel Emelyanov [EMAIL PROTECTED] wrote: Strongly agree. Nobody's interested in swap as such: it's just secondary memory, where

Re: [Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-06 Thread Pavel Emelyanov
Paul Menage wrote: On Thu, Mar 6, 2008 at 12:38 AM, Pavel Emelyanov [EMAIL PROTECTED] wrote: Hierarchical res_counter makes sense. Making it in simple/reasonable style will be our challenge. I have this in my TODO list. Since this is not so urgent, then if you don't mind I can prepare

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-05 Thread Pavel Emelyanov
Hugh Dickins wrote: On Wed, 5 Mar 2008, Pavel Emelyanov wrote: Daisuke Nishimura wrote: Todo: - rebase new kernel, and split into some patches. - Merge with memory subsystem (if it would be better), or remove dependency on CONFIG_CGROUP_MEM_CONT if possible (needs to make

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-05 Thread Hugh Dickins
On Wed, 5 Mar 2008, Pavel Emelyanov wrote: Daisuke Nishimura wrote: Todo: - rebase new kernel, and split into some patches. - Merge with memory subsystem (if it would be better), or remove dependency on CONFIG_CGROUP_MEM_CONT if possible (needs to make page_cgroup more

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-05 Thread Hirokazu Takahashi
Hi, #ifdef CONFIG_CGROUP_MEM_CONT +/* + * A page_cgroup page is associated with every page descriptor. The + * page_cgroup helps us identify information about the cgroup + */ +struct page_cgroup { + struct list_head lru; /* per cgroup LRU list */ + struct page

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-05 Thread KAMEZAWA Hiroyuki
On Wed, 05 Mar 2008 17:14:12 +0300 Pavel Emelyanov [EMAIL PROTECTED] wrote: Strongly agree. Nobody's interested in swap as such: it's just secondary memory, where RAM is primary memory. People want to control memory as the sum of the two; and I expect they may also want to control

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-04 Thread KAMEZAWA Hiroyuki
On Wed, 05 Mar 2008 14:59:05 +0900 Daisuke Nishimura [EMAIL PROTECTED] wrote: #ifdef CONFIG_CGROUP_MEM_CONT +/* + * A page_cgroup page is associated with every page descriptor. The + * page_cgroup helps us identify information about the cgroup + */ +struct page_cgroup { + struct

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-04 Thread KAMEZAWA Hiroyuki
On Wed, 05 Mar 2008 14:59:05 +0900 Daisuke Nishimura [EMAIL PROTECTED] wrote: +int swap_cgroup_charge(struct page *page, + struct swap_info_struct *si, + unsigned long offset) +{ + int ret; + struct page_cgroup *pc; + struct mm_struct

[Devel] Re: [RFC/PATCH] cgroup swap subsystem

2008-03-04 Thread Balbir Singh
Daisuke Nishimura wrote: Hi. Even if limiting memory usage by cgroup memory subsystem or isolating memory by cpuset, swap space is shared, so resource isolation is not enough. If one group uses up all the swap space, it can affect other groups. Yes, that is true. Please ensure that you