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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Thursday, April 8, 2010 - 2:20 pm

On Thu, 08 Apr 2010 21:17:39 +0200
Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:


Well.  The comment there clearly implies (or states) that RCU
protection is used to "guard against races".  If that's inaccurate
or incomplete, can we please get it fixed?


The whole function makes be a bit queasy.

- Fails to explain why it pulls all these party tricks to read
  page->mapping a single time.  What code path are we defending against
  here?

- Then checks page_mapped() without having any apparent defence
  against page_mapped() becoming untrue one nanosecond later.

- Checks page_mapped() inside the rcu_read_locked() section for
  inscrutable reasons.


A comment here explaining how this situation could come about would
be helpful.

--
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 ..., Andrew Morton, (Thu Apr 8, 2:20 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)