From: Michal Hocko Date: Fri, 17 Aug 2018 22:49:10 +0000 (-0700) Subject: mm/oom_kill.c: document oom_lock X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a195d3f5b74f3f45a6742f9063b5e95a2522b46d;p=openwrt%2Fstaging%2Fblogic.git mm/oom_kill.c: document oom_lock Add comments describing oom_lock's scope. Requested-by: David Rientjes Link: http://lkml.kernel.org/r/20180711120121.25635-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: David Rientjes Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index cd6520f7553d..412f43453a68 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -53,6 +53,14 @@ int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; int sysctl_oom_dump_tasks = 1; +/* + * Serializes oom killer invocations (out_of_memory()) from all contexts to + * prevent from over eager oom killing (e.g. when the oom killer is invoked + * from different domains). + * + * oom_killer_disable() relies on this lock to stabilize oom_killer_disabled + * and mark_oom_victim + */ DEFINE_MUTEX(oom_lock); #ifdef CONFIG_NUMA