lkml.org 
[lkml]   [2012]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] srcu: srcu_read_lock() can be called from offline cpu
On Thu, Nov 29, 2012 at 04:46:05PM +0800, Lai Jiangshan wrote:
> SRCU is based on its own statemachine and it doesn't
> relies on normal RCU now, its read critical section can be used in
> offline cpu, so we remove the check and the comments.
>
> It partially reverts c0d6d01b(the part for SRCU).
>
> It also makes the codes match the comments in whatisRCU.txt:
>
> g. Do you need read-side critical sections that are respected
> even though they are in the middle of the idle loop, during
> user-mode execution, or on an offlined CPU? If so, SRCU is the
> only choice that will work for you.

One thing just occurred to me... Won't lockdep refuse to operated on
offline CPUs? If so, one way to handle this would be to flag srcu_struct
structures that were to be used on idle and offline CPUs, and avoid
using lockdep on them. This would allow most uses of SRCU to continue
using lockdep, while avoiding lockdep false positives in other cases.

Or am I confused?

Thanx, Paul

> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> include/linux/srcu.h | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/srcu.h b/include/linux/srcu.h
> index 6eb691b..ae3ee39 100644
> --- a/include/linux/srcu.h
> +++ b/include/linux/srcu.h
> @@ -163,9 +163,6 @@ void srcu_barrier(struct srcu_struct *sp);
> * power mode. This way we can notice an extended quiescent state to
> * other CPUs that started a grace period. Otherwise we would delay any
> * grace period as long as we run in the idle task.
> - *
> - * Similarly, we avoid claiming an SRCU read lock held if the current
> - * CPU is offline.
> */
> static inline int srcu_read_lock_held(struct srcu_struct *sp)
> {
> @@ -173,8 +170,6 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
> return 1;
> if (rcu_is_cpu_idle())
> return 0;
> - if (!rcu_lockdep_current_cpu_online())
> - return 0;
> return lock_is_held(&sp->dep_map);
> }
>
> --
> 1.7.4.4
>



\
 
 \ /
  Last update: 2012-12-05 18:02    [W:0.072 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site