Re: [PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Mathieu Desnoyers
On 2024-09-28 16:58, Alan Stern wrote: On Sat, Sep 28, 2024 at 09:51:28AM -0400, Mathieu Desnoyers wrote: [...] -- Be very careful about comparing pointers obtained from - rcu_dereference() against non-NULL values. As Linus Torvalds - explained, if the two pointers are equal,

Re: [PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Alan Stern
On Sat, Sep 28, 2024 at 09:51:28AM -0400, Mathieu Desnoyers wrote: > Refer to ptr_eq() in the rcu_dereference() documentation. > > ptr_eq() is a mechanism that preserves address dependencies when > comparing pointers, and should be favored when comparing a pointer > obtained from rcu_dereference()

[PATCH 2/2] Documentation: RCU: Refer to ptr_eq()

2024-09-28 Thread Mathieu Desnoyers
Refer to ptr_eq() in the rcu_dereference() documentation. ptr_eq() is a mechanism that preserves address dependencies when comparing pointers, and should be favored when comparing a pointer obtained from rcu_dereference() against another pointer. Signed-off-by: Mathieu Desnoyers Cc: Greg Kroah-H