Re: [RFC PATCH 3/4] hp: Implement Hazard Pointers

2024-10-07 Thread Mathieu Desnoyers
On 2024-10-07 15:47, Boqun Feng wrote: On Thu, Oct 03, 2024 at 09:30:53AM -0400, Mathieu Desnoyers wrote: [...] + /* +* Use RCU dereference without lockdep checks, because +* lockdep is not aware of HP guarantees. +*/ + addr2 = rcu_access_pointer(*addr_p);

Re: [RFC PATCH 3/4] hp: Implement Hazard Pointers

2024-10-07 Thread Boqun Feng
On Thu, Oct 03, 2024 at 09:30:53AM -0400, Mathieu Desnoyers wrote: [...] > > > + /* > > > + * Use RCU dereference without lockdep checks, because > > > + * lockdep is not aware of HP guarantees. > > > + */ > > > + addr2 = rcu_access_pointer(*addr_p);/* Load A */ > > > > Why rcu_access_point

Re: [RFC PATCH 3/4] hp: Implement Hazard Pointers

2024-10-03 Thread Mathieu Desnoyers
On 2024-10-03 02:24, Boqun Feng wrote: On Tue, Oct 01, 2024 at 09:02:04PM -0400, Mathieu Desnoyers wrote: [...] +/* + * hp_allocate: Allocate a hazard pointer. + * + * Allocate a hazard pointer slot for @addr. The object existence should + * be guaranteed by the caller. + * + * Returns a hazard

Re: [RFC PATCH 3/4] hp: Implement Hazard Pointers

2024-10-02 Thread Boqun Feng
On Tue, Oct 01, 2024 at 09:02:04PM -0400, Mathieu Desnoyers wrote: > This API provides existence guarantees of objects through Hazard > Pointers (HP). > > Each HP domain defines a fixed number of hazard pointer slots (nr_cpus) > across the entire system. > > Its main benefit over RCU is that it a

[RFC PATCH 3/4] hp: Implement Hazard Pointers

2024-10-01 Thread Mathieu Desnoyers
This API provides existence guarantees of objects through Hazard Pointers (HP). Each HP domain defines a fixed number of hazard pointer slots (nr_cpus) across the entire system. Its main benefit over RCU is that it allows fast reclaim of HP-protected pointers without needing to wait for a grace p