linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, rientjes@google.com, akpm@linux-foundation.org
Subject: Re: [PATCH v2] mm,oom: Re-enable OOM killer using timeout.
Date: Mon, 25 Apr 2016 13:47:34 +0200	[thread overview]
Message-ID: <20160425114733.GF23933@dhcp22.suse.cz> (raw)
In-Reply-To: <201604201937.AGB86467.MOFFOOQJVFHLtS@I-love.SAKURA.ne.jp>

On Wed 20-04-16 19:37:30, Tetsuo Handa wrote:
[...]
> +static bool is_killable_memdie_task(struct task_struct *p)
> +{
> +	const unsigned long oom_start = p->signal->oom_start;
> +	struct task_struct *t;
> +	bool memdie_pending = false;
> +
> +	if (!oom_start)
> +		return false;
> +	rcu_read_lock();
> +	for_each_thread(p, t) {
> +		if (!test_tsk_thread_flag(t, TIF_MEMDIE))
> +			continue;
> +		memdie_pending = true;
> +		break;
> +	}
> +	rcu_read_unlock();
> +	if (!memdie_pending)
> +		return false;
> +	if (time_after(jiffies, oom_start +
> +		       sysctl_oom_victim_panic_secs * HZ)) {
> +		sched_show_task(p);
> +		panic("Out of memory and %u (%s) can not die...\n",
> +		      p->pid, p->comm);
> +	}
> +	return time_after(jiffies, oom_start +
> +			  sysctl_oom_victim_skip_secs * HZ);
> +}
> +
>  /* return true if the task is not adequate as candidate victim task. */
>  static bool oom_unkillable_task(struct task_struct *p,
>  		struct mem_cgroup *memcg, const nodemask_t *nodemask)
> @@ -149,7 +179,8 @@ static bool oom_unkillable_task(struct task_struct *p,
>  	if (!has_intersects_mems_allowed(p, nodemask))
>  		return true;
>  
> -	return false;
> +	/* Already OOM-killed p might get stuck at unkillable wait */
> +	return is_killable_memdie_task(p);
>  }

Hmm, I guess we have already discussed that in the past but I might
misremember. The above relies on oom killer to be triggered after the
previous victim was selected. There is no guarantee this will happen.
Why cannot we get back to the timer based solution at least for the
panic timeout?
-- 
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-04-25 11:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 15:06 [PATCH] mm,oom: Re-enable OOM killer using timeout Tetsuo Handa
2016-04-19 20:07 ` Michal Hocko
2016-04-19 21:55   ` Tetsuo Handa
2016-04-20 10:37     ` [PATCH v2] " Tetsuo Handa
2016-04-25 11:47       ` Michal Hocko [this message]
2016-04-26 14:00         ` Tetsuo Handa
2016-04-26 14:31           ` Michal Hocko
2016-04-27 10:43             ` Tetsuo Handa
2016-04-20 14:47     ` [PATCH] " Michal Hocko
2016-04-21 11:49       ` Tetsuo Handa
2016-04-21 13:07         ` Michal Hocko
2016-04-24 14:19           ` Tetsuo Handa
2016-04-25  9:55             ` Michal Hocko
2016-04-26 13:54               ` Michal Hocko
2016-04-27 10:43                 ` Tetsuo Handa
2016-04-27 11:11                   ` Michal Hocko
2016-05-14  0:39                     ` Tetsuo Handa
2016-05-16 14:18                       ` Michal Hocko
2016-05-17 11:08                         ` Tetsuo Handa
2016-05-17 12:51                           ` Michal Hocko
2016-04-26 14:00               ` Tetsuo Handa

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=20160425114733.GF23933@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rientjes@google.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).