lkml.org 
[lkml]   [2011]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/7] memcg : comment, style fixes for recent patch of move_parent
    From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

    A fix for 987eba66e0e6aa654d60881a14731a353ee0acb4

    A clean up for mem_cgroup_move_parent().
    - remove unnecessary initialization of local variable.
    - rename charge_size -> page_size
    - remove unnecessary (wrong) comment.

    Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    ---
    mm/memcontrol.c | 17 +++++++++--------
    1 file changed, 9 insertions(+), 8 deletions(-)

    Index: mmotm-0107/mm/memcontrol.c
    ===================================================================
    --- mmotm-0107.orig/mm/memcontrol.c
    +++ mmotm-0107/mm/memcontrol.c
    @@ -2265,7 +2265,7 @@ static int mem_cgroup_move_parent(struct
    struct cgroup *cg = child->css.cgroup;
    struct cgroup *pcg = cg->parent;
    struct mem_cgroup *parent;
    - int charge = PAGE_SIZE;
    + int page_size;
    unsigned long flags;
    int ret;

    @@ -2278,22 +2278,23 @@ static int mem_cgroup_move_parent(struct
    goto out;
    if (isolate_lru_page(page))
    goto put;
    - /* The page is isolated from LRU and we have no race with splitting */
    - charge = PAGE_SIZE << compound_order(page);
    +
    + page_size = PAGE_SIZE << compound_order(page);

    parent = mem_cgroup_from_cont(pcg);
    - ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge);
    + ret = __mem_cgroup_try_charge(NULL, gfp_mask,
    + &parent, false, page_size);
    if (ret || !parent)
    goto put_back;

    - if (charge > PAGE_SIZE)
    + if (page_size > PAGE_SIZE)
    flags = compound_lock_irqsave(page);

    - ret = mem_cgroup_move_account(pc, child, parent, true, charge);
    + ret = mem_cgroup_move_account(pc, child, parent, true, page_size);
    if (ret)
    - mem_cgroup_cancel_charge(parent, charge);
    + mem_cgroup_cancel_charge(parent, page_size);
    put_back:
    - if (charge > PAGE_SIZE)
    + if (page_size > PAGE_SIZE)
    compound_unlock_irqrestore(page, flags);
    putback_lru_page(page);
    put:


    \
     
     \ /
      Last update: 2011-01-21 07:45    [W:0.044 / U:1.148 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site