Messages in this thread Patch in this message | | | From | Pranith Kumar <> | Subject | [PATCH 14/16] slab: Replace smp_read_barrier_depends() with lockless_dereference() | Date | Thu, 13 Nov 2014 14:24:20 -0500 |
| |
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> --- mm/slab.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/slab.h b/mm/slab.h index 3347fd7..1cf40054 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -209,15 +209,15 @@ cache_from_memcg_idx(struct kmem_cache *s, int idx) rcu_read_lock(); params = rcu_dereference(s->memcg_params); - cachep = params->memcg_caches[idx]; - rcu_read_unlock(); /* * Make sure we will access the up-to-date value. The code updating * memcg_caches issues a write barrier to match this (see * memcg_register_cache()). */ - smp_read_barrier_depends(); + cachep = lockless_dereference(params->memcg_caches[idx]); + rcu_read_unlock(); + return cachep; } -- 1.9.1
| |