From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by kanga.kvack.org (Postfix) with ESMTP id 10A7C6B0262 for ; Wed, 27 Apr 2016 10:57:38 -0400 (EDT) Received: by mail-lf0-f69.google.com with SMTP id 68so39685934lfq.2 for ; Wed, 27 Apr 2016 07:57:38 -0700 (PDT) Received: from outbound-smtp05.blacknight.com (outbound-smtp05.blacknight.com. [81.17.249.38]) by mx.google.com with ESMTPS id dg4si4863980wjd.125.2016.04.27.07.57.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Apr 2016 07:57:26 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp05.blacknight.com (Postfix) with ESMTPS id 1CB47986F8 for ; Wed, 27 Apr 2016 14:57:24 +0000 (UTC) From: Mel Gorman Subject: [PATCH 1/6] mm, page_alloc: Only check PageCompound for high-order pages -fix Date: Wed, 27 Apr 2016 15:57:18 +0100 Message-Id: <1461769043-28337-2-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1461769043-28337-1-git-send-email-mgorman@techsingularity.net> References: <1461769043-28337-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Vlastimil Babka , Jesper Dangaard Brouer , Linux-MM , LKML , Mel Gorman Vlastimil Babka pointed out that an unlikely annotation in free_pages_prepare shrinks stack usage by moving compound handling to the end of the function. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-30 (-30) function old new delta free_pages_prepare 771 741 -30 It's also consistent with the buffered_rmqueue path. This is a fix to the mmotm patch mm-page_alloc-only-check-pagecompound-for-high-order-pages.patch. Suggested-by: Vlastimil Babka Signed-off-by: Mel Gorman --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1da56779f8fa..d8383750bd43 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1003,7 +1003,7 @@ static bool free_pages_prepare(struct page *page, unsigned int order) * Check tail pages before head page information is cleared to * avoid checking PageCompound for order-0 pages. */ - if (order) { + if (unlikely(order)) { bool compound = PageCompound(page); int i; -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org