Re: REGRESSION: Performance regressions from switchinganon_vma->lock to mutex

From: Peter Zijlstra
Date: Fri Jun 17 2011 - 13:58:57 EST


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

--
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/