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

2024-10-03 Thread Joel Fernandes
On Thu, Oct 3, 2024 at 10:21 AM Mathieu Desnoyers wrote: > > > > Reviewed-by: Joel Fernandes (Google) > > Please double-check with -O2, and let me know if you still agree with > the patch :) > You are quite right, with -O2 I can indeed see that the optimize hide var fixes it. FWIW: Tested-by: J

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

2024-10-03 Thread Mathieu Desnoyers
On 2024-10-03 02:08, Joel Fernandes wrote: On Tue, Oct 01, 2024 at 09:02:02PM -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 previou

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

2024-10-02 Thread Joel Fernandes
On Tue, Oct 01, 2024 at 09:02:02PM -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. > > Introduce ptr_

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

2024-10-01 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