lkml.org 
[lkml]   [2010]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] memcg: lock-free clear page writeback (Was Re: [PATCH 04/10] memcg: disable local interrupts in lock_page_cgroup()
    On Thu, 7 Oct 2010 15:24:22 +0900
    KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

    > Greg, I think clear_page_writeback() will not require _any_ locks with this patch.
    > But set_page_writeback() requires it...
    > (Maybe adding a special function for clear_page_writeback() is better rather than
    > adding some complex to switch() in update_page_stat())
    >

    I'm testing a code like this.
    ==
    /* pc->mem_cgroup is unstable ? */
    if (unlikely(mem_cgroup_stealed(mem))) {
    /* take a lock against to access pc->mem_cgroup */
    if (!in_interrupt()) {
    lock_page_cgroup(pc);
    need_unlock = true;
    mem = pc->mem_cgroup;
    if (!mem || !PageCgroupUsed(pc))
    goto out;
    } else if (idx == MEMCG_NR_FILE_WRITEBACK && (val < 0)) {
    /* This is allowed */
    } else
    BUG();
    }
    ==
    Thanks,
    -Kame



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