• KAMEZAWA Hiroyuki's avatar
    memcg: avoid unnecessary system-wide-oom-killer · a636b327
    KAMEZAWA Hiroyuki authored
    Current mmtom has new oom function as pagefault_out_of_memory().  It's
    added for select bad process rathar than killing current.
    
    When memcg hit limit and calls OOM at page_fault, this handler called and
    system-wide-oom handling happens.  (means kernel panics if panic_on_oom is
    true....)
    
    To avoid overkill, check memcg's recent behavior before starting
    system-wide-oom.
    
    And this patch also fixes to guarantee "don't accnout against process with
    TIF_MEMDIE".  This is necessary for smooth OOM.
    
    [akpm@linux-foundation.org: build fix]
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Li Zefan <lizf@cn.fujitsu.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
    Cc: Badari Pulavarty <pbadari@us.ibm.com>
    Cc: Jan Blunck <jblunck@suse.de>
    Cc: Hirokazu Takahashi <taka@valinux.co.jp>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    a636b327
oom_kill.c 16.4 KB