lkml.org 
[lkml]   [2013]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] rcu: Create rcu_sync infrastructure
* Peter Zijlstra <peterz@infradead.org> [2013-10-08 12:25:07]:

> From: Oleg Nesterov <oleg@redhat.com>
>
> It is functionally equivalent to
>
> struct rcu_sync_struct {
> atomic_t counter;
> };
>
> static inline bool rcu_sync_is_idle(struct rcu_sync_struct *xxx)
> {
> return atomic_read(&xxx->counter) == 0;
> }
>
> static inline void rcu_sync_enter(struct rcu_sync_struct *xxx)
> {
> atomic_inc(&xxx->counter);
> synchronize_sched();
> }
>
> static inline void rcu_sync_enter(struct rcu_sync_struct *xxx)

Guess you meant rcu_sync_exit

> {
> synchronize_sched();
> atomic_dec(&xxx->counter);
> }
>
> except: it records the state and synchronize_sched() is only called by
> rcu_sync_enter() and only if necessary.
>

--
Thanks and Regards
Srikar Dronamraju



\
 
 \ /
  Last update: 2013-10-17 13:01    [W:0.219 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site