lkml.org 
[lkml]   [2008]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 4/21] memcg-swapout-refcnt-fix.patch
    Fix for memcg-memswap-controller-core.patch

    css's refcnt is dropped before end of following access.
    Hold it until end of access.

    Reported-by: Li Zefan <lizf@cn.fujitsu.com>
    Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

    mm/memcontrol.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    Index: mmotm-2.6.28-Dec01-2/mm/memcontrol.c
    ===================================================================
    --- mmotm-2.6.28-Dec01-2.orig/mm/memcontrol.c
    +++ mmotm-2.6.28-Dec01-2/mm/memcontrol.c
    @@ -1171,7 +1171,9 @@ __mem_cgroup_uncharge_common(struct page
    mz = page_cgroup_zoneinfo(pc);
    unlock_page_cgroup(pc);

    - css_put(&mem->css);
    + /* at swapout, this memcg will be accessed to record to swap */
    + if (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT)
    + css_put(&mem->css);

    return mem;

    @@ -1212,6 +1214,8 @@ void mem_cgroup_uncharge_swapcache(struc
    swap_cgroup_record(ent, memcg);
    mem_cgroup_get(memcg);
    }
    + if (memcg)
    + css_put(&memcg->css);
    }

    #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP


    \
     
     \ /
      Last update: 2008-12-03 05:57    [W:4.095 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site