From: Xishi Qiu <qiuxishi@huawei.com>
To: ChengYi He <chengyihetaipei@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <js1304@gmail.com>, Yaowei Bai <bywxiaobai@163.com>,
Alexander Duyck <alexander.h.duyck@redhat.com>,
"'Kirill A . Shutemov'" <kirill.shutemov@linux.intel.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] mm/page_alloc: avoid splitting pages of order 2 and 3 in migration fallback
Date: Sat, 30 Jan 2016 18:41:53 +0800 [thread overview]
Message-ID: <56AC9371.5030605@huawei.com> (raw)
In-Reply-To: <46b854accad3f40e4178cf3bbd215a4648551763.1454094692.git.chengyihetaipei@gmail.com>
On 2016/1/30 3:25, ChengYi He wrote:
> While buddy system fallbacks to allocate different migration type pages,
> it prefers the largest feasible pages and might split the chosen page
> into smalller ones. If the largest feasible pages are less than or equal
> to orde-3 and migration fallback happens frequently, then order-2 and
> order-3 pages can be exhausted easily. This patch aims to allocate the
> smallest feasible pages for the fallback mechanism under this condition.
>
> Signed-off-by: ChengYi He <chengyihetaipei@gmail.com>
> ---
> mm/page_alloc.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 50c325a..3fcb653 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1802,9 +1802,22 @@ __rmqueue_fallback(struct zone *zone, unsigned int order, int start_migratetype)
> struct page *page;
>
> /* Find the largest possible block of pages in the other list */
> - for (current_order = MAX_ORDER-1;
> - current_order >= order && current_order <= MAX_ORDER-1;
> - --current_order) {
> + for (current_order = MAX_ORDER - 1;
> + current_order >= max_t(unsigned int, PAGE_ALLOC_COSTLY_ORDER + 1, order);
> + --current_order) {
> + page = __rmqueue_fallback_order(zone, order, start_migratetype,
> + current_order);
> +
> + if (page)
> + return page;
> + }
> +
> + /*
> + * While current_order <= PAGE_ALLOC_COSTLY_ORDER, find the smallest
> + * feasible pages in the other list to avoid splitting high order pages
> + */
> + for (current_order = order; current_order <= PAGE_ALLOC_COSTLY_ORDER;
> + ++current_order) {
> page = __rmqueue_fallback_order(zone, order, start_migratetype,
> current_order);
>
Hi Chengyi,
So you mean use the largest block first, if no large block left, the use the
smallest block, right?
I have an idea, how about set two migrate types(movable and unmovable) when
doing init work? The function is memmap_init_zone().
I don't know how to set the ratio, maybe unmovable takes 1/10 memory, and left
9/10 memory to movable? I think this effect is a little like the two zones
(normal and movable).
Another two ideas
https://lkml.org/lkml/2015/8/14/67
7d348b9ea64db0a315d777ce7d4b06697f946503, maybe this patch is not applied on your 3.10
Thanks,
Xishi Qiu
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: ChengYi He <chengyihetaipei@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
Michal Hocko <mhocko@suse.com>,
"Vlastimil Babka" <vbabka@suse.cz>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <js1304@gmail.com>, Yaowei Bai <bywxiaobai@163.com>,
Alexander Duyck <alexander.h.duyck@redhat.com>,
"'Kirill A . Shutemov'" <kirill.shutemov@linux.intel.com>,
Johannes Weiner <hannes@cmpxchg.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 2/2] mm/page_alloc: avoid splitting pages of order 2 and 3 in migration fallback
Date: Sat, 30 Jan 2016 18:41:53 +0800 [thread overview]
Message-ID: <56AC9371.5030605@huawei.com> (raw)
In-Reply-To: <46b854accad3f40e4178cf3bbd215a4648551763.1454094692.git.chengyihetaipei@gmail.com>
On 2016/1/30 3:25, ChengYi He wrote:
> While buddy system fallbacks to allocate different migration type pages,
> it prefers the largest feasible pages and might split the chosen page
> into smalller ones. If the largest feasible pages are less than or equal
> to orde-3 and migration fallback happens frequently, then order-2 and
> order-3 pages can be exhausted easily. This patch aims to allocate the
> smallest feasible pages for the fallback mechanism under this condition.
>
> Signed-off-by: ChengYi He <chengyihetaipei@gmail.com>
> ---
> mm/page_alloc.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 50c325a..3fcb653 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1802,9 +1802,22 @@ __rmqueue_fallback(struct zone *zone, unsigned int order, int start_migratetype)
> struct page *page;
>
> /* Find the largest possible block of pages in the other list */
> - for (current_order = MAX_ORDER-1;
> - current_order >= order && current_order <= MAX_ORDER-1;
> - --current_order) {
> + for (current_order = MAX_ORDER - 1;
> + current_order >= max_t(unsigned int, PAGE_ALLOC_COSTLY_ORDER + 1, order);
> + --current_order) {
> + page = __rmqueue_fallback_order(zone, order, start_migratetype,
> + current_order);
> +
> + if (page)
> + return page;
> + }
> +
> + /*
> + * While current_order <= PAGE_ALLOC_COSTLY_ORDER, find the smallest
> + * feasible pages in the other list to avoid splitting high order pages
> + */
> + for (current_order = order; current_order <= PAGE_ALLOC_COSTLY_ORDER;
> + ++current_order) {
> page = __rmqueue_fallback_order(zone, order, start_migratetype,
> current_order);
>
Hi Chengyi,
So you mean use the largest block first, if no large block left, the use the
smallest block, right?
I have an idea, how about set two migrate types(movable and unmovable) when
doing init work? The function is memmap_init_zone().
I don't know how to set the ratio, maybe unmovable takes 1/10 memory, and left
9/10 memory to movable? I think this effect is a little like the two zones
(normal and movable).
Another two ideas
https://lkml.org/lkml/2015/8/14/67
7d348b9ea64db0a315d777ce7d4b06697f946503, maybe this patch is not applied on your 3.10
Thanks,
Xishi Qiu
next prev parent reply other threads:[~2016-01-30 10:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 19:23 [RFC PATCH 0/2] avoid external fragmentation related to migration fallback ChengYi He
2016-01-29 19:23 ` ChengYi He
2016-01-29 19:24 ` [RFC PATCH 1/2] mm/page_alloc: let migration fallback support pages of requested order ChengYi He
2016-01-29 19:24 ` ChengYi He
2016-01-29 19:25 ` [RFC PATCH 2/2] mm/page_alloc: avoid splitting pages of order 2 and 3 in migration fallback ChengYi He
2016-01-29 19:25 ` ChengYi He
2016-01-30 10:41 ` Xishi Qiu [this message]
2016-01-30 10:41 ` Xishi Qiu
2016-01-29 21:03 ` [RFC PATCH 0/2] avoid external fragmentation related to " Vlastimil Babka
2016-01-29 21:03 ` Vlastimil Babka
2016-01-30 10:21 ` Xishi Qiu
2016-01-30 10:21 ` Xishi Qiu
2016-02-01 13:53 ` Mel Gorman
2016-02-01 13:53 ` Mel Gorman
2016-02-02 1:01 ` Xishi Qiu
2016-02-02 1:01 ` 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=56AC9371.5030605@huawei.com \
--to=qiuxishi@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@redhat.com \
--cc=bywxiaobai@163.com \
--cc=chengyihetaipei@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=js1304@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=rientjes@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.