Re: memcg creates an unkillable task in 3.11-rc2

From: Michal Hocko
Date: Wed Jul 31 2013 - 03:37:51 EST

[I am CCing David here as well]

On Tue 30-07-13 09:37:46, Eric W. Biederman wrote:
> Michal Hocko <mhocko@xxxxxxx> writes:
> > On Tue 30-07-13 01:19:31, Eric W. Biederman wrote:
> > [...]
> >> Hmm. Looking farther I see what is going on. And it has nothing to do
> >> with the freezer. (I have commented out that code and reproduced it
> >> without the freezer to be doubly certain).
> >>
> >>
> >> On the exit path exit_robust_list is triggering a page fault to fault a
> >> page back in. Which since we have no memory causes the exit path
> >> to get stuck in mem_cgroup_handle_oom.
> >
> > Hmm, interesting. I assume the exit is caused by the SIGKILL, right?
> > If yes, then why it hasn't coughed early in __mem_cgroup_try_charge
> Interesting question. This isn't the primary thread but we do send
> SIGKILL to the secondary threads as well.
> We definitely need those checks on both paths making my change valid.
> Oh. Duh! This is after we act on SIGKILL so SIGKILL is no longer
> pending.

Very well spotted Eric! What do you think about the following patch?
I would have to check since when the exit path could trigger the fault
but I guess this is worth stable backport.