But that's exactly what we do in rmap_walk() anyway.
But yes, I can well imagine that in other cases we only do the one
anon_vma. I didn't check who used the lock.
So if we do want to keep the lock in the anon_vma, I would just suggest
that instead of making "normal" users do lots of locking, make the
rmap_walk side one.
Heh. AIM7. Wasn't that why we merged the multiple anon_vma's in the first
place?
Do we care?
We've not locked them all there, and we've historically not cares about
the rmap list being "perfect", have we?
So I _think_ it's just the migration case (and apparently potentially the
hugepage case) that wants _exact_ information. Which is why I suggest the
onus of the extra locking should be on _them_, not on the regular code.
I dunno. Again, my objections to the patches are really based more on a
gut feel of "that can't be the right thing to do" than anything else.
We have _extremely_ few places that walk lists to lock things. And they
are never "normal" code. Things like that magic "mm_take_all_locks()", for
example. That is why I then react with "that can't be right" to patches
like this.
Linus
--