Skip to contentSkip to conversation

slab: do not call compound_head() in page_get_cache()

PATCH In review Michel Lespinasse 3 participants 3 messages Jun 20, 2012 – Jul 2, 2012 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slab: do not call compound_head() in page_get_cache()

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().

---
 mm/slab.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
mm/slab.c +0 -1
index e901a36..6a1aa1f 100644
@@ -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;
 }
Signature · 7 lines
1.7.7.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Michel Lespinasse

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().

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 11 lines · David Rientjes
Quoted 7 lines · Michel Lespinasse

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().

The page_get_cache() helper is no longer used in the slab/next branch of

git://github.com/penberg/linux.git

Pekka

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>