[PATCH -v2] freezer: check OOM kill while being frozen

From: Michal Hocko
Date: Fri Oct 17 2014 - 03:47:03 EST


On Thu 16-10-14 19:33:39, Cong Wang wrote:
> On Thu, Oct 16, 2014 at 3:22 PM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > On 10/16, Cong Wang wrote:
> >>
> >> On Thu, Oct 16, 2014 at 2:35 PM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >> >
> >> > If a task B is already frozen, it sleeps in D state.
> >> >
> >> > If OOM selects B as a victim after that, it won't be woken by
> >> > SIGKILL, thus it obviously can't call should_thaw_current() and
> >> > notice TIF_MEMDIE.
> >>
> >> I see your point now, it would be more clear if you can just quote
> >> the patch instead of changelog.
> >>
> >> So are you saying the loop in __refrigerator() is useless?
> >
> > No.
> >
> >> Since
> >> it will always stay in asleep after schedule()?
> >
> > Not always. But it will stay asleep in this particular case.
>
> Hmm, so we still need to wake it up in oom killer:
>
> if (test_tsk_thread_flag(task, TIF_MEMDIE)) {
> if (unlikely(frozen(task)))
> wake_up_state(task, TASK_UNINTERRUPTIBLE);
>
> I will update the patch if Michal doesn't.

I think we should rather get back to __thaw_task here.

Andrew could you replace the previous version by this one, please? Again
I am sorry I haven't caught that before.
---