From: Wei Yang <richard.weiyang@gmail.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] oom: improve oom disable handling
Date: Wed, 10 May 2017 10:47:10 +0800 [thread overview]
Message-ID: <20170510024710.GB8480@WeideMBP.lan> (raw)
In-Reply-To: <20170404134705.6361-1-mhocko@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3272 bytes --]
Hi, Michal
If the subject is "improve the log message on oom disable handling" would be
more accurate to me.
The original subject sounds the patch will adjust the code path, while it
doesn't.
On Tue, Apr 04, 2017 at 03:47:05PM +0200, Michal Hocko wrote:
>From: Michal Hocko <mhocko@suse.com>
>
>Tetsuo has reported that sysrq triggered OOM killer will print a
>misleading information when no tasks are selected:
>
>[ 713.805315] sysrq: SysRq : Manual OOM execution
>[ 713.808920] Out of memory: Kill process 4468 ((agetty)) score 0 or sacrifice child
>[ 713.814913] Killed process 4468 ((agetty)) total-vm:43704kB, anon-rss:1760kB, file-rss:0kB, shmem-rss:0kB
>[ 714.004805] sysrq: SysRq : Manual OOM execution
>[ 714.005936] Out of memory: Kill process 4469 (systemd-cgroups) score 0 or sacrifice child
>[ 714.008117] Killed process 4469 (systemd-cgroups) total-vm:10704kB, anon-rss:120kB, file-rss:0kB, shmem-rss:0kB
>[ 714.189310] sysrq: SysRq : Manual OOM execution
>[ 714.193425] sysrq: OOM request ignored because killer is disabled
>[ 714.381313] sysrq: SysRq : Manual OOM execution
>[ 714.385158] sysrq: OOM request ignored because killer is disabled
>[ 714.573320] sysrq: SysRq : Manual OOM execution
>[ 714.576988] sysrq: OOM request ignored because killer is disabled
>
>The real reason is that there are no eligible tasks for the OOM killer
>to select but since 7c5f64f84483bd13 ("mm: oom: deduplicate victim
>selection code for memcg and global oom") the semantic of out_of_memory
>has changed without updating moom_callback.
>
>This patch updates moom_callback to tell that no task was eligible
>which is the case for both oom killer disabled and no eligible tasks.
>In order to help distinguish first case from the second add printk to
>both oom_killer_{enable,disable}. This information is useful on its own
>because it might help debugging potential memory allocation failures.
>
>Fixes: 7c5f64f84483bd13 ("mm: oom: deduplicate victim selection code for memcg and global oom")
>Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>Signed-off-by: Michal Hocko <mhocko@suse.com>
>---
> drivers/tty/sysrq.c | 2 +-
> mm/oom_kill.c | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
>index 71136742e606..a91f58dc2cb6 100644
>--- a/drivers/tty/sysrq.c
>+++ b/drivers/tty/sysrq.c
>@@ -370,7 +370,7 @@ static void moom_callback(struct work_struct *ignored)
>
> mutex_lock(&oom_lock);
> if (!out_of_memory(&oc))
>- pr_info("OOM request ignored because killer is disabled\n");
>+ pr_info("OOM request ignored. No task eligible\n");
> mutex_unlock(&oom_lock);
> }
>
>diff --git a/mm/oom_kill.c b/mm/oom_kill.c
>index 51c091849dcb..ad2b112cdf3e 100644
>--- a/mm/oom_kill.c
>+++ b/mm/oom_kill.c
>@@ -682,6 +682,7 @@ void exit_oom_victim(void)
> void oom_killer_enable(void)
> {
> oom_killer_disabled = false;
>+ pr_info("OOM killer enabled.\n");
> }
>
> /**
>@@ -718,6 +719,7 @@ bool oom_killer_disable(signed long timeout)
> oom_killer_enable();
> return false;
> }
>+ pr_info("OOM killer disabled.\n");
>
> return true;
> }
>--
>2.11.0
--
Wei Yang
Help you, Help me
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2017-05-10 2:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 13:47 [PATCH] oom: improve oom disable handling Michal Hocko
2017-05-10 2:47 ` Wei Yang [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170510024710.GB8480@WeideMBP.lan \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=vdavydov.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).