[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120708144538.GB18272@localhost>
Date: Sun, 8 Jul 2012 22:45:38 +0800
From: Fengguang Wu <fengguang.wu@...el.com>
To: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Sha Zhengju <handai.szj@...il.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, gthelen@...gle.com, yinghan@...gle.com,
akpm@...ux-foundation.org, mhocko@...e.cz,
linux-kernel@...r.kernel.org, Sha Zhengju <handai.szj@...bao.com>
Subject: Re: [PATCH 5/7] memcg: add per cgroup dirty pages accounting
On Tue, Jul 03, 2012 at 02:57:08PM +0900, KAMEZAWA Hiroyuki wrote:
> (2012/06/28 20:04), Sha Zhengju wrote:
> > From: Sha Zhengju <handai.szj@...bao.com>
> >
> > This patch adds memcg routines to count dirty pages, which allows memory controller
> > to maintain an accurate view of the amount of its dirty memory and can provide some
> > info for users while group's direct reclaim is working.
> >
> > After Kame's commit 89c06bd5(memcg: use new logic for page stat accounting), we can
> > use 'struct page' flag to test page state instead of per page_cgroup flag. But memcg
> > has a feature to move a page from a cgroup to another one and may have race between
> > "move" and "page stat accounting". So in order to avoid the race we have designed a
> > bigger lock:
> >
> > mem_cgroup_begin_update_page_stat()
> > modify page information -->(a)
> > mem_cgroup_update_page_stat() -->(b)
> > mem_cgroup_end_update_page_stat()
> >
> > It requires (a) and (b)(dirty pages accounting) can stay close enough.
> >
> > In the previous two prepare patches, we have reworked the vfs set page dirty routines
> > and now the interfaces are more explicit:
> > incrementing (2):
> > __set_page_dirty
> > __set_page_dirty_nobuffers
> > decrementing (2):
> > clear_page_dirty_for_io
> > cancel_dirty_page
> >
> >
> > Signed-off-by: Sha Zhengju <handai.szj@...bao.com>
>
> Thank you. This seems much cleaner than expected ! very good.
>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujtisu.com>
I have the same good feelings :)
Acked-by: Fengguang Wu <fengguang.wu@...el.com>
--
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