From: Gavin Shan Date: Fri, 9 Nov 2012 03:03:55 +0000 (+1100) Subject: mm/page_alloc.c: remove duplicate check X-Git-Tag: next-20121113~6^2~266 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ff08be31840e1a978788e5f4693d341c2e5ddc42;p=karo-tx-linux.git mm/page_alloc.c: 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 Acked-by: Pekka Enberg Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2311f1585744..f323b213af0c 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++; }