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:	Tue, 18 Nov 2014 09:16:39 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Pranith Kumar <bobby.prani@...il.com>
Cc:	Josh Triplett <josh@...htriplett.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	"open list:READ-COPY UPDATE..." <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/16] rcupdate: Replace smp_read_barrier_depends() with
 lockless_dereference()

On Thu, Nov 13, 2014 at 02:24:14PM -0500, Pranith Kumar wrote:
> Recently lockless_dereference() was added which can be used in place of
> hard-coding smp_read_barrier_depends(). The following PATCH makes the change.
> 
> Signed-off-by: Pranith Kumar <bobby.prani@...il.com>

Queued for 3.20, thank you!  I was wondering about your removing the
"_" from "_________p1", but see that this allowed you to avoid the
checkpatch.pl warning.  ;-)

							Thanx, Paul

> ---
>  include/linux/rcupdate.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index ed4f593..386ba28 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -582,11 +582,11 @@ static inline void rcu_preempt_sleep_check(void)
>  })
>  #define __rcu_dereference_check(p, c, space) \
>  ({ \
> -	typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \
> +	/* Dependency order vs. p above. */ \
> +	typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \
>  	rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \
>  	rcu_dereference_sparse(p, space); \
> -	smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
> -	((typeof(*p) __force __kernel *)(_________p1)); \
> +	((typeof(*p) __force __kernel *)(________p1)); \
>  })
>  #define __rcu_dereference_protected(p, c, space) \
>  ({ \
> @@ -603,10 +603,10 @@ static inline void rcu_preempt_sleep_check(void)
>  })
>  #define __rcu_dereference_index_check(p, c) \
>  ({ \
> -	typeof(p) _________p1 = ACCESS_ONCE(p); \
> +	/* Dependency order vs. p above. */ \
> +	typeof(p) _________p1 = lockless_dereference(p); \
>  	rcu_lockdep_assert(c, \
>  			   "suspicious rcu_dereference_index_check() usage"); \
> -	smp_read_barrier_depends(); /* Dependency order vs. p above. */ \
>  	(_________p1); \
>  })
> 
> -- 
> 1.9.1
> 

--
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