Re: REGRESSION: Performance regressions from switching anon_vma->lockto mutex

From: Linus Torvalds
Date: Thu Jun 16 2011 - 17:33:36 EST

On Thu, Jun 16, 2011 at 2:06 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Jun 16, 2011 at 2:05 PM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>> This patch is UNTESTED!
> It was also UNATTACHED!

Hmm. And it doesn't work. We deadlock when we free the anon_vma
because the *freeing* path wants to take the anon_vma lock. See that
horrid code in anon_vma_free().

So now we now hold the root over the whole series of frees, and get an
instant deadlock.

We also can happen to free the root anon_vma before we release the
lock in it, which is another slight problem ;)

So the unlink_anon_vmas() case is actually much more complicated than
the clone case.

In other words, just forget that second patch. I'll have to think about it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at