lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 30 May 2015 21:16:52 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	Peter Zijlstra <peterz@...radead.org>, tj@...nel.org,
	mingo@...hat.com, linux-kernel@...r.kernel.org, der.herr@...r.at,
	dave@...olabs.net, torvalds@...ux-foundation.org
Subject: Re: [RFC][PATCH 1/5] rcu: Create rcu_sync infrastructure

On 05/30, Paul E. McKenney wrote:
>
> On Tue, May 26, 2015 at 01:43:57PM +0200, Peter Zijlstra wrote:
> > From: Oleg Nesterov <oleg@...hat.com>
> >
> > It is functionally equivalent to
> >
> >         struct rcu_sync_struct {
> >                 atomic_t counter;
> >         };
> >
> >         static inline bool rcu_sync_is_idle(struct rcu_sync_struct *rss)
> >         {
> >                 return atomic_read(&rss->counter) == 0;
> >         }
> >
> >         static inline void rcu_sync_enter(struct rcu_sync_struct *rss)
> >         {
> >                 atomic_inc(&rss->counter);
> >                 synchronize_sched();
> >         }
>
> For vanilla RCU, this is called get_state_synchronize_rcu().
>
> >         static inline void rcu_sync_exit(struct rcu_sync_struct *rss)
> >         {
> >                 synchronize_sched();
> >                 atomic_dec(&rss->counter);
> >         }
> >
> > except: it records the state and synchronize_sched() is only called by
> > rcu_sync_enter() and only if necessary.
>
> Again for vanilla RCU, this is called cond_synchronize_rcu().

Hmm. I do not understand... I think rcu_sync doesn't need
get_state/cond_synchronize.

The first caller of rcu_sync_enter() always needs sync(). The next one
could use cond_synchronize_rcu(), but for what? The 2nd one will wait
for the end of gp started by the first caller, and this is more optimal?

Note that rcu_sync_enter/rcu_sync_func never call sync() unless strictly
necessary.

Or I misunderstood you?

Oleg.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ