Messages in this thread | | | Date | Thu, 8 Jan 2015 12:51:24 +0100 | From | Michal Hocko <> | Subject | Re: [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
| |