Re: REGRESSION: Performance regressions from switching anon_vma->lock to mutex

Linus Torvalds
2011-06-17T16:49:42Z

On Fri, Jun 17, 2011 at 4:28 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>
> Something like so? Compiles and runs the benchmark in question.

Yup.

Except I really think that test for a NULL anon_vma should go away.

If an avc entry has a NULL anon_vma, something is seriously wrong. The
comment about anon_vma_fork failure is definitely just bogus: the
anon_vma is allocated before the avc entry, so there's no way a avc
can have a NULL anon_vma from there.

But yes, your patch is cleaner than the one I was playing around with
(your "remove if not list empty" is prettier than what I was toying
with - having a separate flag in the avc)

Tim, can you test Peter's (second - the cleaned up one) patch on top
of mine, and see if that helps things further?

The only thing I don't love about the batching is that we now do hold
the lock over some situations where we _could_ have allowed
concurrency (notably some avc allocations), but I think it's a good
trade-off. And walking the list twice at unlink_anon_vmas() should be
basically free.

Linus