• KAMEZAWA Hiroyuki's avatar
    memcg: handle panic_on_oom=always case · daaf1e68
    KAMEZAWA Hiroyuki authored
    Presently, if panic_on_oom=2, the whole system panics even if the oom
    happend in some special situation (as cpuset, mempolicy....).  Then,
    panic_on_oom=2 means painc_on_oom_always.
    
    Now, memcg doesn't check panic_on_oom flag. This patch adds a check.
    
    BTW, how it's useful ?
    
    kdump+panic_on_oom=2 is the last tool to investigate what happens in
    oom-ed system.  When a task is killed, the sysytem recovers and there will
    be few hint to know what happnes.  In mission critical system, oom should
    never happen.  Then, panic_on_oom=2+kdump is useful to avoid next OOM by
    knowing precise information via snapshot.
    
    TODO:
     - For memcg, it's for isolate system's memory usage, oom-notiifer and
       freeze_at_oom (or rest_at_oom) should be implemented. Then, management
       daemon can do similar jobs (as kdump) or taking snapshot per cgroup.
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Nick Piggin <npiggin@suse.de>
    Reviewed-by: default avatarDaisuke 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>
    daaf1e68
oom_kill.c 17.9 KB