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:   Thu, 3 Oct 2019 10:01:23 -0400
From:   Joel Fernandes <joel@...lfernandes.org>
To:     "Paul E. McKenney" <paulmck@...nel.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        David Howells <dhowells@...hat.com>, rcu@...r.kernel.org,
        linux-kernel@...r.kernel.org, mingo@...nel.org,
        jiangshanlai@...il.com, dipankar@...ibm.com,
        akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
        josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
        edumazet@...gle.com, fweisbec@...il.com, oleg@...hat.com,
        Bart Van Assche <bart.vanassche@....com>,
        Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>,
        Johannes Thumshirn <jthumshirn@...e.de>,
        Shane M Seymour <shane.seymour@....com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH tip/core/rcu 1/9] rcu: Upgrade rcu_swap_protected() to
 rcu_replace()

On Thu, Oct 03, 2019 at 06:33:15AM -0700, Paul E. McKenney wrote:
> On Thu, Oct 03, 2019 at 09:08:50AM -0400, Steven Rostedt wrote:
> > On Thu, 03 Oct 2019 09:39:17 +0100
> > David Howells <dhowells@...hat.com> wrote:
> > 
> > > paulmck@...nel.org wrote:
> > > 
> > > > +#define rcu_replace(rcu_ptr, ptr, c)					\
> > > > +({									\
> > > > +	typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c));	\
> > > > +	rcu_assign_pointer((rcu_ptr), (ptr));				\
> > > > +	__tmp;								\
> > > > +})  
> > > 
> > > Does it make sense to actually use xchg() if that's supported by the arch?
> 
> Historically, xchg() has been quite a bit slower than a pair of assignment
> statements, in part due to the strong memory ordering guaranteed by
> xchg().  Has that changed?  If so, then, agreed, it might make sense to
> use xchg().

For the kfree_rcu() performance testing I was working on recently, replacing
xchg() with a pair of assignment statements in the code being tested provided
a great performance increase (on x86).

thanks,

 - Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ