lkml.org 
[lkml]   [2010]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 06/11] memcg: add dirty page accounting infrastructure
    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


    \
     
     \ /
      Last update: 2010-10-29 13:15    [W:3.983 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site