lkml.org 
[lkml]   [2010]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation
    On Mon, Mar 01, 2010 at 05:02:08PM -0500, Vivek Goyal wrote:
    > > @@ -686,10 +699,14 @@ void throttle_vm_writeout(gfp_t gfp_mask)
    > > */
    > > dirty_thresh += dirty_thresh / 10; /* wheeee... */
    > >
    > > - if (global_page_state(NR_UNSTABLE_NFS) +
    > > - global_page_state(NR_WRITEBACK) <= dirty_thresh)
    > > - break;
    > > - congestion_wait(BLK_RW_ASYNC, HZ/10);
    > > +
    > > + dirty = mem_cgroup_page_stat(MEMCG_NR_DIRTY_WRITEBACK_PAGES);
    > > + if (dirty < 0)
    > > + dirty = global_page_state(NR_UNSTABLE_NFS) +
    > > + global_page_state(NR_WRITEBACK);
    >
    > dirty is unsigned long. As mentioned last time, above will never be true?
    > In general these patches look ok to me. I will do some testing with these.

    Re-introduced the same bug. My bad. :(

    The value returned from mem_cgroup_page_stat() can be negative, i.e.
    when memory cgroup is disabled. We could simply use a long for dirty,
    the unit is in # of pages so s64 should be enough. Or cast dirty to long
    only for the check (see below).

    Thanks!
    -Andrea

    Signed-off-by: Andrea Righi <arighi@develer.com>
    ---
    mm/page-writeback.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/mm/page-writeback.c b/mm/page-writeback.c
    index d83f41c..dbee976 100644
    --- a/mm/page-writeback.c
    +++ b/mm/page-writeback.c
    @@ -701,7 +701,7 @@ void throttle_vm_writeout(gfp_t gfp_mask)


    dirty = mem_cgroup_page_stat(MEMCG_NR_DIRTY_WRITEBACK_PAGES);
    - if (dirty < 0)
    + if ((long)dirty < 0)
    dirty = global_page_state(NR_UNSTABLE_NFS) +
    global_page_state(NR_WRITEBACK);
    if (dirty <= dirty_thresh)

    \
     
     \ /
      Last update: 2010-03-01 23:21    [W:0.022 / U:34.416 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site