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

Peter Zijlstra
2011-06-17T17:58:50Z

On Fri, 2011-06-17 at 10:41 -0700, Hugh Dickins wrote:
> > 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.
>
> Applying load with those two patches applied (combined patch shown at
> the bottom, in case you can tell me I misunderstood what to apply,
> and have got the wrong combination on), lockdep very soon protested.

Gah, of course. Its exactly the case Linus mentioned not loving. We can
get reclaim recursion due to the avc allocation, we hold anon_vma->mutex
while doing a (blocking) allocation, and reclaim can end up trying to
obtain said lock trying to free some memory.

Bugger. /me goes investigate