[PATCH] adapt page_lock_anon_vma() to PREEMPT_RCU
commit34bbd704051c9d053d69e90569a3a2365f4c7b50
authorOleg Nesterov <oleg@tv-sign.ru>
Thu, 1 Mar 2007 04:13:49 +0000 (28 20:13 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 1 Mar 2007 22:53:39 +0000 (1 14:53 -0800)
treef5fb6f3941cd09be0fb92ae80f9759ad64fca709
parent48dba8ab9b93c3b6b57946bd45ae013402b0b054
[PATCH] adapt page_lock_anon_vma() to PREEMPT_RCU

page_lock_anon_vma() uses spin_lock() to block RCU.  This doesn't work with
PREEMPT_RCU, we have to do rcu_read_lock() explicitely.  Otherwise, it is
theoretically possible that slab returns anon_vma's memory to the system
before we do spin_unlock(&anon_vma->lock).

[ Hugh points out that this only matters for PREEMPT_RCU, which isn't merged
  yet, and may never be.  Regardless, this patch is conceptually the
  right thing to do, even if it doesn't matter at this point.  - Linus ]

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/rmap.c