aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2017-03-30 23:07:09 -0400
committerMoyster <oysterized@gmail.com>2018-05-16 13:24:41 +0200
commit8dee796c6a523ca052d558df176e0fd27f7e07fd (patch)
treedad2398e4eaeb57ebe7528adf2da90e2c33a102e /mm
parent9cfb88485844ba83beed5854e7458677bba4f5c1 (diff)
always perform cache_from_obj sanity checks
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/mm/slab.h b/mm/slab.h
index 7bb74447b..cc47f1e4a 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -209,16 +209,6 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
struct kmem_cache *cachep;
struct page *page;
- /*
- * When kmemcg is not being used, both assignments should return the
- * same value. but we don't want to pay the assignment price in that
- * case. If it is not compiled in, the compiler should be smart enough
- * to not do even the assignment. In that case, slab_equal_or_root
- * will also be a constant.
- */
- if (!memcg_kmem_enabled() && !unlikely(s->flags & SLAB_DEBUG_FREE))
- return s;
-
page = virt_to_head_page(x);
BUG_ON(!PageSlab(page));
cachep = page->slab_cache;