mm,oom_reaper: remove pointless kthread_run() error check
Since oom_init() is called before userspace processes start, memory allocation failure for creating the OOM reaper kernel thread will let the OOM killer call panic() rather than wake up the OOM reaper. Link: http://lkml.kernel.org/r/1510137800-4602-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e492080e64
commit
c50842c8e1
|
@ -640,9 +640,6 @@ static int oom_reaper(void *unused)
|
||||||
|
|
||||||
static void wake_oom_reaper(struct task_struct *tsk)
|
static void wake_oom_reaper(struct task_struct *tsk)
|
||||||
{
|
{
|
||||||
if (!oom_reaper_th)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* tsk is already queued? */
|
/* tsk is already queued? */
|
||||||
if (tsk == oom_reaper_list || tsk->oom_reaper_list)
|
if (tsk == oom_reaper_list || tsk->oom_reaper_list)
|
||||||
return;
|
return;
|
||||||
|
@ -660,11 +657,6 @@ static void wake_oom_reaper(struct task_struct *tsk)
|
||||||
static int __init oom_init(void)
|
static int __init oom_init(void)
|
||||||
{
|
{
|
||||||
oom_reaper_th = kthread_run(oom_reaper, NULL, "oom_reaper");
|
oom_reaper_th = kthread_run(oom_reaper, NULL, "oom_reaper");
|
||||||
if (IS_ERR(oom_reaper_th)) {
|
|
||||||
pr_err("Unable to start OOM reaper %ld. Continuing regardless\n",
|
|
||||||
PTR_ERR(oom_reaper_th));
|
|
||||||
oom_reaper_th = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
subsys_initcall(oom_init)
|
subsys_initcall(oom_init)
|
||||||
|
|
Loading…
Reference in New Issue