lkml.org 
[lkml]   [2007]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] adapt page_lock_anon_vma() to PREEMPT_RCU
> On Sun, 25 Feb 2007 23:06:21 +0300 Oleg Nesterov <oleg@tv-sign.ru> wrote:
> 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).
>
> ...
>
> +static void page_unlock_anon_vma(struct anon_vma *anon_vma)
> +{
> + spin_unlock(&anon_vma->lock);
> + rcu_read_unlock();
> }

It's a bit sad doing a double preempt_disable() for non-PREEMPT_RCU builds.

Perhaps we would benefit from a new rcu_read_lock_preempt_rcu() which is a
no-op if !PREEMPT_RCU.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-27 21:35    [W:0.041 / U:1.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site