Re: [PATCH 1/2] mm,migration: Prevent rmap_walk_[anon|ksm] seeing the wrong VMA information

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mel Gorman
Date: Wednesday, May 5, 2010 - 7:56 am

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] Fix migration races in rmap_walk() V5, Mel Gorman, (Wed May 5, 6:14 am)
Re: [PATCH 1/2] mm,migration: Prevent rmap_walk_[anon|ksm] ..., Mel Gorman, (Wed May 5, 7:56 am)
Re: [PATCH 1/2] mm,migration: Prevent rmap_walk_[anon|ksm] ..., KAMEZAWA Hiroyuki, (Thu May 6, 12:38 am)
Re: [PATCH 1/2] mm,migration: Prevent rmap_walk_[anon|ksm] ..., KAMEZAWA Hiroyuki, (Thu May 6, 10:49 pm)