linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Dave Jones <davej@codemonkey.org.uk>
Cc: linux-mm@kvack.org
Subject: Re: oom-reaper choosing wrong processes.
Date: Wed, 20 Jul 2016 15:39:03 +0200	[thread overview]
Message-ID: <20160720133903.GO11249@dhcp22.suse.cz> (raw)
In-Reply-To: <20160720133337.GA12457@codemonkey.org.uk>

On Wed 20-07-16 09:33:37, Dave Jones wrote:
> On Wed, Jul 20, 2016 at 09:23:04AM -0400, Dave Jones wrote:
>  
>  >  > so this task has been already oom reaped and so oom_badness will ignore
>  >  > it (it simply doesn't make any sense to select this task because it
>  >  > has been already killed or exiting and oom reaped as well). Others might
>  >  > be in a similar position or they might have passed exit_mm->tsk->mm = NULL
>  >  > so they are ignored by the oom killer as well.
>  > 
>  > I feel like I'm still missing something.  Why isn't "wait for the already reaped trinity tasks to exit"
>  > the right thing to do here (as my diff forced it to do), instead of "pick even more victims even
>  > though we've already got some reaped processes that haven't exited"
>  > 
>  > Not killing systemd-journald allowed the machine to keep running just fine.
>  > If I hadn't have patched that out, it would have been killed unnecessarily.
> 
> nm, I figured it out. As Tetsuo pointed out, I was leaking a task struct,
> so those already reaped trinity processes would never truly 'exit'.

Leaked task_struct would leak some memory but they shouldn't have any
effect on the task visibility to the oom killer. Tasks are basically
visible until they are unhashed from the task_list. But the leak could
indeed have some other side effects - like pinning a lot of memory and
so the OOM kill wouldn't be sufficient to make a forward progress.

-- 
Michal Hocko
SUSE Labs

--
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-20 13:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 23:18 Dave Jones
2016-07-19  9:08 ` Michal Hocko
2016-07-19 10:52   ` Tetsuo Handa
2016-07-19 15:36     ` Dave Jones
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 [this message]
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=20160720133903.GO11249@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-mm@kvack.org \
    /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