Re: [PATCH v3 11/11] memcg: check memcg dirty limits in pagewriteback
From: Daisuke Nishimura
Date: Wed Oct 20 2010 - 00:45:11 EST
On Wed, 20 Oct 2010 13:18:57 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> On Tue, 19 Oct 2010 10:00:15 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> > On Mon, 18 Oct 2010 17:39:44 -0700
> > Greg Thelen <gthelen@xxxxxxxxxx> wrote:
> >
> > > If the current process is in a non-root memcg, then
> > > global_dirty_limits() will consider the memcg dirty limit.
> > > This allows different cgroups to have distinct dirty limits
> > > which trigger direct and background writeback at different
> > > levels.
> > >
> > > Signed-off-by: Andrea Righi <arighi@xxxxxxxxxxx>
> > > Signed-off-by: Greg Thelen <gthelen@xxxxxxxxxx>
> >
> > Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> >
> Why FREEPAGES in memcg is not counted as dirtyable ?
>
It's counted as memcg_hierarchical_free_pages() in mem_cgroup_page_stat().
As for FREEPAGES, we should count ancestors, not children.
mem_cgroup_page_stat():
1311 if (mem && !mem_cgroup_is_root(mem)) {
1312 /*
1313 * If we're looking for dirtyable pages we need to evaluate
1314 * free pages depending on the limit and usage of the parents
1315 * first of all.
1316 */
1317 if (item == MEMCG_NR_DIRTYABLE_PAGES)
1318 value = memcg_hierarchical_free_pages(mem);
1319 else
1320 value = 0;
1321 /*
1322 * Recursively evaluate page statistics against all cgroup
1323 * under hierarchy tree
1324 */
1325 for_each_mem_cgroup_tree(iter, mem)
1326 value += mem_cgroup_local_page_stat(iter, item);
--
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/