Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-28 Thread Paul E. McKenney
On Fri, Sep 27, 2024 at 07:05:53PM -0400, Mathieu Desnoyers wrote: > On 2024-09-27 22:33, Mathieu Desnoyers wrote: > [...] > > > --- > > include/linux/compiler.h | 62 > > 1 file changed, 62 insertions(+) > > > > I'm wondering if this really belongs in

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Boqun Feng
On Fri, Sep 27, 2024 at 07:05:53PM -0400, Mathieu Desnoyers wrote: > On 2024-09-27 22:33, Mathieu Desnoyers wrote: > [...] > > > --- > > include/linux/compiler.h | 62 > > 1 file changed, 62 insertions(+) > > > > I'm wondering if this really belongs in

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Boqun Feng
[Cc Gary] On Fri, Sep 27, 2024 at 04:33:34PM -0400, Mathieu Desnoyers wrote: > Compiler CSE and SSA GVN optimizations can cause the address dependency > of addresses returned by rcu_dereference to be lost when comparing those > pointers with either constants or previously loaded pointers. > > Int

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 22:33, Mathieu Desnoyers wrote: [...] --- include/linux/compiler.h | 62 1 file changed, 62 insertions(+) I'm wondering if this really belongs in compiler.h, or if it's so RCU/HP specific that it should be implemented in rcupdate.h ?

[RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Mathieu Desnoyers
Compiler CSE and SSA GVN optimizations can cause the address dependency of addresses returned by rcu_dereference to be lost when comparing those pointers with either constants or previously loaded pointers. Introduce ptr_eq() to compare two addresses while preserving the address dependencies for l