Commit 8df0c2dc authored by Pranith Kumar's avatar Pranith Kumar Committed by Linus Torvalds
Browse files

slab: replace smp_read_barrier_depends() with lockless_dereference()

Recently lockless_dereference() was added which can be used in place of
hard-coding smp_read_barrier_depends().  The following PATCH makes the

Signed-off-by: default avatarPranith Kumar <>
Cc: "Paul E. McKenney" <>
Cc: Christoph Lameter <>
Cc: Pekka Enberg <>
Cc: David Rientjes <>
Cc: Joonsoo Kim <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c871ac4e
......@@ -209,15 +209,15 @@ cache_from_memcg_idx(struct kmem_cache *s, int idx)
params = rcu_dereference(s->memcg_params);
cachep = params->memcg_caches[idx];
* 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()).
cachep = lockless_dereference(params->memcg_caches[idx]);
return cachep;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment