OpenVZ Forum


Home » Mailing lists » Devel » Re: [PATCH v4 06/11] memcg: add dirty page accounting infrastructure
Re: [PATCH v4 06/11] memcg: add dirty page accounting infrastructure [message #41897] Fri, 29 October 2010 11:13
Wu Fengguang is currently offline  Wu Fengguang
Messages: 5
Registered: October 2010
Junior Member
From: *parallels.com
On Fri, Oct 29, 2010 at 03:09:09PM +0800, Greg Thelen wrote:

> +
> + case MEMCG_NR_FILE_DIRTY:
> + /* Use Test{Set,Clear} to only un/charge the memcg once. */
> + if (val > 0) {
> + if (TestSetPageCgroupFileDirty(pc))
> + val = 0;
> + } else {
> + if (!TestClearPageCgroupFileDirty(pc))
> + val = 0;
> + }

I'm wondering why TestSet/TestClear and even the cgroup page flags for
dirty/writeback/unstable pages are necessary at all (it helps to
document in changelog if there are any). For example, VFS will call
TestSetPageDirty() before calling
mem_cgroup_inc_page_stat(MEMCG_NR_FILE_DIRTY), so there should be no
chance of false double counting.

Thanks,
Fengguang
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Previous Topic: Re: [PATCH v4 02/11] memcg: document cgroup dirty memory interfaces
Next Topic: Need help to debug container's freeze
Goto Forum:
  


Current Time: Sun Nov 17 17:27:21 GMT 2019