Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965021AbaGDHxx (ORCPT ); Fri, 4 Jul 2014 03:53:53 -0400 Received: from lgeamrelo01.lge.com ([156.147.1.125]:43574 "EHLO lgeamrelo01.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbaGDHxI (ORCPT ); Fri, 4 Jul 2014 03:53:08 -0400 X-Original-SENDERIP: 10.177.220.145 X-Original-MAILFROM: iamjoonsoo.kim@lge.com From: Joonsoo Kim To: Andrew Morton Cc: "Kirill A. Shutemov" , Rik van Riel , Peter Zijlstra , Mel Gorman , Johannes Weiner , Minchan Kim , Yasuaki Ishimatsu , Zhang Yanfei , "Srivatsa S. Bhat" , Tang Chen , Naoya Horiguchi , Bartlomiej Zolnierkiewicz , Wen Congyang , Marek Szyprowski , Michal Nazarewicz , Laura Abbott , Heesub Shin , "Aneesh Kumar K.V" , Ritesh Harjani , t.stanislaws@samsung.com, Gioh Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim Subject: [PATCH 10/10] mm/page_alloc: Stop merging pages on non-isolate and isolate buddy list Date: Fri, 4 Jul 2014 16:57:55 +0900 Message-Id: <1404460675-24456-11-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404460675-24456-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1404460675-24456-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we merge pages on non-isolate buddy list and isolate buddy list, respectively, we should fixup freepage count, because we don't regard pages in isolate buddy list as freepage. But this will impose some overhead on __free_one_page() which is core function of page free path so this overhead looks undesirable to me. Instead, we can stop merging in this case. With this approach, we can skip to fixup freepage count with low overhead. The side-effect of this change is that some buddies equal or larger than pageblock order isn't merged if one of buddy is on isolate pageblock. But, I think that this is no problem, because isolation means that we will use page on isolate pageblock specially, so it will split soon in any case. Signed-off-by: Joonsoo Kim --- mm/page_alloc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 80c9bd8..da4da66 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -648,6 +648,24 @@ static inline void __free_one_page(struct page *page, break; /* + * Stop merging between page on non-isolate buddy list and + * isolate buddy list, respectively. This case is only possible + * for pages equal or larger than pageblock_order, because + * pageblock migratetype can be changed in this granularity. + */ + if (unlikely(order >= pageblock_order && + has_isolate_pageblock(zone))) { + int buddy_mt = get_onbuddy_migratetype(buddy); + + if (migratetype != buddy_mt) { + if (is_migrate_isolate(migratetype)) + break; + else if (is_migrate_isolate(buddy_mt)) + break; + } + } + + /* * Our buddy is free or it is CONFIG_DEBUG_PAGEALLOC guard page, * merge with it and move up one order. */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/