]> git.baikalelectronics.ru Git - kernel.git/commit
oom, oom_reaper: do not enqueue task if it is on the oom_reaper_list head
authorMichal Hocko <mhocko@suse.com>
Fri, 1 Apr 2016 21:31:34 +0000 (14:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 1 Apr 2016 22:03:37 +0000 (17:03 -0500)
commit66b7a8b70ac0f5f99e6ad0d99eab86ac837146f7
treef2e5c0a39e0916f76310e4f923f00055498fdb62
parentc7719560672ac7350b39c762751eb3064236e4c1
oom, oom_reaper: do not enqueue task if it is on the oom_reaper_list head

Commit 6e3e665f00ad ("oom, oom_reaper: protect oom_reaper_list using
simpler way") has simplified the check for tasks already enqueued for
the oom reaper by checking tsk->oom_reaper_list != NULL.  This check is
not sufficient because the tsk might be the head of the queue without
any other tasks queued and then we would simply lockup looping on the
same task.  Fix the condition by checking for the head as well.

Fixes: 6e3e665f00ad ("oom, oom_reaper: protect oom_reaper_list using simpler way")
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/oom_kill.c