lkml.org 
[lkml]   [2015]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v2 5/5] OOM, PM: make OOM detection in the freezer path raceless
On Fri 05-12-14 17:41:47, Michal Hocko wrote:
[...]
> +bool oom_killer_disable(void)
> +{
> + /*
> + * Make sure to not race with an ongoing OOM killer
> + * and that the current is not the victim.
> + */
> + down_write(&oom_sem);
> + if (test_thread_flag(TIF_MEMDIE)) {
> + up_write(&oom_sem);
> + return false;
> + }
> +
> + oom_killer_disabled = true;
> + up_write(&oom_sem);
> +
> + wait_event(oom_victims_wait, atomic_read(&oom_victims));

Ups brainfart... Should be !atomic_read(&oom_victims). Condition says
for what we are waiting not when we are waiting.

> +
> + return true;
> +}
[...]
--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2015-01-08 13:01    [W:0.205 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site