From: Xishi Qiu <qiuxishi@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Vlastimil Babka <vbabka@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>,
iamjoonsoo.kim@lge.com, alexander.h.duyck@redhat.com,
sasha.levin@oracle.com
Cc: Linux MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] mm: add the block to the tail of the list in expand()
Date: Fri, 31 Jul 2015 17:30:15 +0800 [thread overview]
Message-ID: <55BB4027.7080200@huawei.com> (raw)
__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@huawei.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, 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2015-07-31 9:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 9:30 Xishi Qiu [this message]
2015-07-31 23:24 ` [PATCH] mm: add the block to the tail of the list in expand() Dave Hansen
2015-08-03 2:05 ` Xishi Qiu
2015-08-03 4:10 ` Dave Hansen
2015-08-04 1:13 ` Xishi Qiu
2015-08-04 14:27 ` Dave Hansen
2015-08-05 7:54 ` Xishi Qiu
2015-08-05 14:47 ` Dave Hansen
2015-08-14 7:55 ` Xishi Qiu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BB4027.7080200@huawei.com \
--to=qiuxishi@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=sasha.levin@oracle.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).