Re: [RFC PATCH] percpu_ref: Make percpu_ref_tryget*() ACQUIRE operations

2021-04-16 Thread Huang, Ying
Kent Overstreet writes: > On Thu, Apr 15, 2021 at 09:42:56PM -0700, Paul E. McKenney wrote: >> On Tue, Apr 13, 2021 at 10:47:03AM +0800, Huang Ying wrote: >> > One typical use case of percpu_ref_tryget() family functions is as >> > follows, >> > >> > if (percpu_ref_tryget(>ref)) { >> >

Re: [RFC PATCH] percpu_ref: Make percpu_ref_tryget*() ACQUIRE operations

2021-04-15 Thread Kent Overstreet
On Thu, Apr 15, 2021 at 09:42:56PM -0700, Paul E. McKenney wrote: > On Tue, Apr 13, 2021 at 10:47:03AM +0800, Huang Ying wrote: > > One typical use case of percpu_ref_tryget() family functions is as > > follows, > > > > if (percpu_ref_tryget(>ref)) { > > /* Operate on the other fields of

Re: [RFC PATCH] percpu_ref: Make percpu_ref_tryget*() ACQUIRE operations

2021-04-15 Thread Paul E. McKenney
On Tue, Apr 13, 2021 at 10:47:03AM +0800, Huang Ying wrote: > One typical use case of percpu_ref_tryget() family functions is as > follows, > > if (percpu_ref_tryget(>ref)) { > /* Operate on the other fields of *p */ > } > > The refcount needs to be checked before operating on the

[RFC PATCH] percpu_ref: Make percpu_ref_tryget*() ACQUIRE operations

2021-04-12 Thread Huang Ying
One typical use case of percpu_ref_tryget() family functions is as follows, if (percpu_ref_tryget(>ref)) { /* Operate on the other fields of *p */ } The refcount needs to be checked before operating on the other fields of the data structure (*p), otherwise, the values gotten from