Skip to content

Commit

Permalink
percpu: Replace smp_read_barrier_depends() with lockless_dereference()
Browse files Browse the repository at this point in the history
Recently lockless_dereference() was added which can be used in place of
hard-coding smp_read_barrier_depends(). The following PATCH makes the change.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Pranith Kumar authored and Tejun Heo committed Nov 22, 2014
1 parent cceb9bd commit eadac03
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/linux/percpu-refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ static inline void percpu_ref_kill(struct percpu_ref *ref)
static inline bool __ref_is_percpu(struct percpu_ref *ref,
unsigned long __percpu **percpu_countp)
{
unsigned long percpu_ptr = ACCESS_ONCE(ref->percpu_count_ptr);

/* paired with smp_store_release() in percpu_ref_reinit() */
smp_read_barrier_depends();
unsigned long percpu_ptr = lockless_dereference(ref->percpu_count_ptr);

if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC))
return false;
Expand Down

0 comments on commit eadac03

Please sign in to comment.