• KAMEZAWA Hiroyuki's avatar
    memcg: update threshold and softlimit at commit · 430e4863
    KAMEZAWA Hiroyuki authored
    Presently, move_task does "batched" precharge.  Because res_counter or
    css's refcnt are not-scalable jobs for memcg, try_charge_()..  tend to be
    done in batched manner if allowed.
    
    Now, softlimit and threshold check their event counter in try_charge, but
    the charge is not a per-page event.  And event counter is not updated at
    charge().  Moreover, precharge doesn't pass "page" to try_charge() and
    softlimit tree will be never updated until uncharge() causes an event."
    
    So the best place to check the event counter is commit_charge().  This is
    per-page event by its nature.  This patch move checks to there.
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
    Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    430e4863
memcontrol.c 108 KB