Re: [PATCH v2] mm,oom: Re-enable OOM killer using timeout.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]