linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jones <davej@codemonkey.org.uk>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Michal Hocko <mhocko@kernel.org>, linux-mm@kvack.org
Subject: Re: oom-reaper choosing wrong processes.
Date: Tue, 19 Jul 2016 11:36:37 -0400	[thread overview]
Message-ID: <20160719153637.GB11863@codemonkey.org.uk> (raw)
In-Reply-To: <c77149ec-960c-d10a-0410-d09fe47bb14f@I-love.SAKURA.ne.jp>

On Tue, Jul 19, 2016 at 07:52:28PM +0900, Tetsuo Handa wrote:
 > On 2016/07/19 8:18, Dave Jones wrote:
 > > Whoa. Why did it pick systemd-journal ?
 > 
 > I guess that it is because all trinity processes' mm already had MMF_OOM_REAPED set.
 > 
 > The OOM reaper sets MMF_OOM_REAPED when OOM reap operation succeeded. But
 > "[ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name" listing
 > includes processes whose mm already has MMF_OOM_REAPED set. As a result, trinity-c15 and
 > trinity-c4 are shown again in the listing. While I can't confirm that trinity-c10, trinity-c2,
 > trinity-c0 and trinity-c11 are already OOM killed, I guess they are already OOM killed and
 > their mm already had MMF_OOM_REAPED set.

That still doesn't explain why it picked the journal process, instead of waiting until
the previous reaping operation had actually killed those Trinity tasks.

 > > My 'skip over !trinity processes' code kicks in, and it then kills the right processes, and the box lives on,
 > > but if I hadn't have had that diff, the wrong process would have been killed.
 > 
 > As of Linux 4.7, processes whose mm already has MMF_OOM_REAPED can be selected for many
 > times due to not checking MMF_OOM_REAPED when using task_will_free_mem() shortcut in
 > out_of_memory(). (It will be fixed in Linux 4.8.) That is, I guess that your system had
 > already hit
 > 
 >   panic("Out of memory and no killable processes...\n")
 > 
 > if trinity processes with MMF_OOM_REAPED mm were not selected again and again.

That panic was not hit. The machine continued running after killing the right tasks.

	Dave

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

  reply	other threads:[~2016-07-19 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 23:18 oom-reaper choosing wrong processes Dave Jones
2016-07-19  9:08 ` Michal Hocko
2016-07-19 10:52   ` Tetsuo Handa
2016-07-19 15:36     ` Dave Jones [this message]
2016-07-20 10:40       ` Tetsuo Handa
2016-07-19 15:33   ` Dave Jones
2016-07-20  7:09     ` Michal Hocko
2016-07-20 13:23       ` Dave Jones
2016-07-20 13:33         ` Dave Jones
2016-07-20 13:39           ` Michal Hocko
2016-07-20 13:36         ` 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:
  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=20160719153637.GB11863@codemonkey.org.uk \
    --to=davej@codemonkey.org.uk \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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).