Linux-mm Archive on
 help / color / Atom feed
From: Tetsuo Handa <>
Cc:, Tetsuo Handa <>
Subject: [PATCH] mm,oom_reaper: Remove pointless kthread_run() error check.
Date: Wed,  8 Nov 2017 19:43:20 +0900
Message-ID: <> (raw)

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.

Signed-off-by: Tetsuo Handa <>
 mm/oom_kill.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 8dd0e08..85eced9 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -641,9 +641,6 @@ static int oom_reaper(void *unused)
 static void wake_oom_reaper(struct task_struct *tsk)
-	if (!oom_reaper_th)
-		return;
 	/* tsk is already queued? */
 	if (tsk == oom_reaper_list || tsk->oom_reaper_list)
@@ -661,11 +658,6 @@ static void wake_oom_reaper(struct task_struct *tsk)
 static int __init oom_init(void)
 	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;

To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to  For more info on Linux MM,
see: .
Don't email: <a href=mailto:""> </a>

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 10:43 Tetsuo Handa [this message]
2017-11-08 15:01 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone