We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b918653 commit 82c1775Copy full SHA for 82c1775
mm/slab.h
@@ -574,13 +574,13 @@ static inline void memcg_slab_free_hook(struct kmem_cache *s,
574
575
static inline struct kmem_cache *virt_to_cache(const void *obj)
576
{
577
- struct page *page;
+ struct slab *slab;
578
579
- page = virt_to_head_page(obj);
580
- if (WARN_ONCE(!PageSlab(page), "%s: Object is not a Slab page!\n",
+ slab = virt_to_slab(obj);
+ if (WARN_ONCE(!slab, "%s: Object is not a Slab page!\n",
581
__func__))
582
return NULL;
583
- return page->slab_cache;
+ return slab->slab_cache;
584
}
585
586
static __always_inline void account_slab(struct slab *slab, int order,
0 commit comments