[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <55BB4027.7080200@huawei.com>
Date: Fri, 31 Jul 2015 17:30:15 +0800
From: Xishi Qiu <qiuxishi@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>, <iamjoonsoo.kim@....com>,
<alexander.h.duyck@...hat.com>, <sasha.levin@...cle.com>
CC: Linux MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm: add the block to the tail of the list in expand()
__free_one_page() will judge whether the the next-highest order is free,
then add the block to the tail or not. So when we split large order block,
add the small block to the tail, it will reduce fragment.
Signed-off-by: Xishi Qiu <qiuxishi@...wei.com>
---
mm/page_alloc.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 506eac8..517a11c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1267,7 +1267,12 @@ static inline void expand(struct zone *zone, struct page *page,
set_page_guard(zone, &page[size], high, migratetype);
continue;
}
- list_add(&page[size].lru, &area->free_list[migratetype]);
+ /*
+ * Add the block to the tail of the list, so it's less likely
+ * to be used soon and more likely to be merged when the page
+ * is freed.
+ */
+ list_add_tail(&page[size].lru, &area->free_list[migratetype]);
area->nr_free++;
set_page_order(&page[size], high);
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists