On Wed, May 05, 2010 at 07:34:37AM -0700, Linus Torvalds wrote:
I could not convince myself that it wasn't. lockdep throws a fit if you try
but it can be taught about the situation if necessary.
rmap_walk() appears to be the only one that takes multiple locks but it itself
is not serialised. If there are more than one process calling rmap_walk()
on different processes sharing the same VMAs, is there a guarantee they walk
it in the same order? I didn't think so at the time the patch because the
anon_vma the walk starts from is based on the page being migrated rather
than any idea of starting from a parent or primary anon_vma.
If we always started the list walk in the same place then it'd be fine but
if they start in different places, it could deadlock.
I imagined it and I'm not super-happy about it. It's one of the reasons Rik
called it "fragile".
Just what I have above. I couldn't convince myself that two callers to
rmap_walk from pages based on different VMAs on the same_anon_vma list would
always started in the same place.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--