[PATCH] slab: do not call compound_head() in page_get_cache()

From: Michel Lespinasse
Date: Wed Jun 20 2012 - 19:01:27 EST


page_get_cache() does not need to call compound_head(), as its unique
caller virt_to_slab() already makes sure to return a head page.

Additionally, removing the compound_head() call makes page_get_cache()
consistent with page_get_slab().

Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx>
---
mm/slab.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index e901a36..6a1aa1f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -501,7 +501,6 @@ static inline void page_set_cache(struct page *page, struct kmem_cache *cache)

static inline struct kmem_cache *page_get_cache(struct page *page)
{
- page = compound_head(page);
BUG_ON(!PageSlab(page));
return (struct kmem_cache *)page->lru.next;
}
--
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/