Re: [PATCH 02/13] mm: Revalidate anon_vma in page_lock_anon_vma()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KOSAKI Motohiro
Date: Thursday, April 8, 2010 - 11:34 pm

> On Fri, 9 Apr 2010 13:16:41 +1000

Why?
IIUC. page->mapping dereference in page_lock_anon_vma() makes four story.

1. the anon_vma is valid
	-> do page_referenced_one(). 
2. the anon_vma is invalid and freed to buddy
	-> bail out by page_mapped(), no touch anon_vma
3. the anon_vma is kfreed, and not reused
	-> bail out by page_mapped()
4. the anon_vma is kfreed, but reused as another anon_vma
	-> bail out by page_check_address()

Now we have to consider 5th story.

5. the anon_vma is exchanged another anon_vma by do_wp_page.
	-> bail out by above bailing out stuff.


I agree peter's patch makes sense. but I don't think Rik's patch change
locking rule.







--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 02/13] mm: Revalidate anon_vma in page_lock_ano ..., KOSAKI Motohiro, (Thu Apr 8, 11:34 pm)
Re: [PATCH 02/13] mm: Revalidate anon_vma in page_lock_ano ..., KAMEZAWA Hiroyuki, (Thu Apr 8, 11:47 pm)
Re: [PATCH 02/13] mm: Revalidate anon_vma in page_lock_ano ..., KAMEZAWA Hiroyuki, (Fri Apr 9, 12:57 am)
mlock and pageout race?, Minchan Kim, (Fri Apr 9, 7:41 am)