Re: [PATCH v4] mm: per-thread vma caching

From: Oleg Nesterov
Date: Sat Mar 08 2014 - 14:58:11 EST


looks like I removed lkml somehow, resend...

On 03/08, Linus Torvalds wrote:
>
> On Sat, Mar 8, 2014 at 10:40 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >
> > It seems this should be moved into copy_mm(), CLONE_VM needs to invalidate
> > ->vmacache too.
>
> No it doesn't. CLONE_VM doesn't change any of the vma lists,

Sure. But another thread or CLONE_VM task can do vmacache_invalidate(),
hit vmacache_seqnum == 0 and call vmacache_flush_all() to solve the
problem with potential overflow.

> so
> there's no reason to invalidate anything.
>
> > dup_task_struct() also copies vmacache_seqnum/vmacache, but the new thread
> > is not yet visible to vmacache_flush_all().
>
> So either the new task struct will share the mm, in which case the
> cache entries are fine

Not if they should be flushed by vmacache_flush_all() above.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/