@@ -410,8 +410,7 @@ static inline struct kmem_cache *virt_to_cache(const void *obj)
struct page *page;
page = virt_to_head_page(obj);
- if (WARN_ONCE(!PageSlab(compound_head(page)),
- "%s: Object is not a Slab page!\n",
+ if (WARN_ONCE(!PageSlab(page), "%s: Object is not a Slab page!\n",
__func__))
return NULL;
return page->slab_cache;
@@ -564,7 +564,7 @@ bool kmem_valid_obj(void *object)
if (object < (void *)PAGE_SIZE || !virt_addr_valid(object))
return false;
page = virt_to_head_page(object);
- return PageSlab(compound_head(page));
+ return PageSlab(page);
}
EXPORT_SYMBOL_GPL(kmem_valid_obj);
@@ -594,7 +594,7 @@ void kmem_dump_obj(void *object)
if (WARN_ON_ONCE(!virt_addr_valid(object)))
return;
page = virt_to_head_page(object);
- if (WARN_ON_ONCE(!PageSlab(compound_head(page)))) {
+ if (WARN_ON_ONCE(!PageSlab(page))) {
pr_cont(" non-slab memory.\n");
return;
}
virt_to_head_page() implies it. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> --- mm/slab.h | 3 +-- mm/slab_common.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)