Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

From: KAMEZAWA Hiroyuki
Date: Wed Mar 03 2010 - 22:49:01 EST


On Wed, 3 Mar 2010 23:03:19 +0100
Andrea Righi <arighi@xxxxxxxxxxx> wrote:

> On Wed, Mar 03, 2010 at 05:21:32PM +0900, KAMEZAWA Hiroyuki wrote:
> > On Wed, 3 Mar 2010 15:15:49 +0900
> > KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> > + preempt_disable();
> > + lock_page_cgroup_migrate(pc);
> > page = pc->page;
> > if (page_mapped(page) && !PageAnon(page)) {
> > /* Update mapped_file data for mem_cgroup */
> > - preempt_disable();
> > __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
> > __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
> > - preempt_enable();
> > }
> > mem_cgroup_charge_statistics(from, pc, false);
> > + move_acct_information(from, to, pc);
>
> Kame-san, a question. According to is_target_pte_for_mc() it seems we
> don't move file pages across cgroups for now.

yes. It's just in plan.

> If !PageAnon(page) we just return 0 and the page won't be selected for migration in
> mem_cgroup_move_charge_pte_range().
>
> So, if I've understood well the code is correct in perspective, but
> right now it's unnecessary. File pages are not moved on task migration
> across cgroups and, at the moment, there's no way for file page
> accounted statistics to go negative.
>
> Or am I missing something?
>

At rmdir(), remainging file caches in a cgroup is moved to
its parent. Then, all file caches are moved to its parent at rmdir().

This behavior is for avoiding to lose too much file caches at removing cgroup.

Thanks,
-Kame


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/