Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core)
From: Michal Hocko
Date: Fri Jun 24 2016 - 11:06:55 EST
On Fri 24-06-16 16:05:58, Michal Hocko wrote:
> On Thu 23-06-16 20:52:21, Oleg Nesterov wrote:
> > On 06/23, Linus Torvalds wrote:
> > >
> > > On Thu, Jun 23, 2016 at 10:03 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > > >
> > > > Let me quote my previous email ;)
> > > >
> > > > And we can't free/nullify it when the parent/debuger reaps a zombie,
> > > > say, mark_oom_victim() expects that get_task_struct() protects
> > > > thread_info as well.
> > > >
> > > > probably we can fix all such users though...
> > >
> > > TIF_MEMDIE is indeed a potential problem, but I don't think
> > > mark_oom_victim() is actually problematic.
> > >
> > > mark_oom_victim() is called with either "current",
> >
> > This is no longer true in -mm tree.
> >
> > But I agree, this is fixable (and in fact I still hope TIF_MEMDIE will die,
> > at least in its current form).
>
> We can move the flag to the task_struct. There are still some bits left
> there. This would be trivial so that the oom usage doesn't stay in the
> way.
Here is the patch. I've found two bugs when the TIF_MEMDIE was checked
on current rather than the given task. I will separate them into their
own patches (was just too lazy for it now). If the approach looks
reasonable then I will repost next week.
---