From 85f7299b2a117fc073b35afcd7309ce825b40ca2 Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Tue, 14 Aug 2012 13:22:32 +1000 Subject: [PATCH] mm/slab: remove duplicate check While allocating pages using buddy allocator, the compound page is probably split up to free pages. Under these circumstances, the compound page should be destroyed by destroy_compound_page(). However, there is a duplicate check to judge if the page is compound. Remove the duplicate check since the compound_order() returns 0 when the page doesn't have PG_head set in destroy_compound_page(). That is to say, destroy_compound_page() needn't check PageHead(). Signed-off-by: Gavin Shan Acked-by: Johannes Weiner Cc: Pekka Enberg Signed-off-by: Andrew Morton --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c66fb875104a..5b3cc334b3bb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -368,8 +368,7 @@ static int destroy_compound_page(struct page *page, unsigned long order) int nr_pages = 1 << order; int bad = 0; - if (unlikely(compound_order(page) != order) || - unlikely(!PageHead(page))) { + if (unlikely(compound_order(page) != order)) { bad_page(page); bad++; } -- 2.39.5