]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/page_alloc.c: remove duplicate check
authorGavin Shan <shangw@linux.vnet.ibm.com>
Thu, 25 Oct 2012 01:14:46 +0000 (12:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 31 Oct 2012 05:49:44 +0000 (16:49 +1100)
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 <shangw@linux.vnet.ibm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 5b74de6702e06587e0d4f36060f810526ff8fbe3..d1729472e5cdd6b7a86a39ed9cc9924955382c36 100644 (file)
@@ -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++;
        }