aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranith Kumar <[email protected]>2014-12-10 15:42:28 -0800
committerLinus Torvalds <[email protected]>2014-12-10 17:41:04 -0800
commit8df0c2dcf61781d2efa8e6e5b06870f6c6785735 (patch)
tree69f8d7dcfde84ba42315db10862dfb197668b5bb
parentc871ac4e9666ad68ae861172ef8a7f73d6e61b26 (diff)
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 change. Signed-off-by: Pranith Kumar <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slab.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/slab.h b/mm/slab.h
index 53a55c70c409..078acbcf64e8 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;
}