From: Vlastimil Babka <vbabka@suse.cz>
To: Weijie Yang <weijie.yang@samsung.com>, iamjoonsoo.kim@lge.com
Cc: 'Andrew Morton' <akpm@linux-foundation.org>,
mgorman@suse.de, 'Rik van Riel' <riel@redhat.com>,
'Johannes Weiner' <hannes@cmpxchg.org>,
'Minchan Kim' <minchan@kernel.org>,
'Weijie Yang' <weijie.yang.kh@gmail.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: page_isolation: remove redundant moving for isolated buddy pages
Date: Tue, 09 Dec 2014 10:14:45 +0100 [thread overview]
Message-ID: <5486BD85.1010903@suse.cz> (raw)
In-Reply-To: <000101d01384$fac61240$f05236c0$%yang@samsung.com>
On 12/09/2014 08:50 AM, Weijie Yang wrote:
> The commit ad53f92e(fix incorrect isolation behavior by rechecking migratetype)
> patch series describe the race between page isolation and alloc/free path, and
> fix the race.
>
> Now, after the pageblock has been isolated, free buddy pages are already in
> the free_list[MIGRATE_ISOLATE] and will not be allocated for usage. So the
> current freepage_migratetype check is unnecessary and it will cause redundant
> page move. That is to say, even if the buddy page's migratetype is not
> MIGRATE_ISOLATE, the page is in free_list[MIGRATE_ISOLATE], we just move it
> from free_list[MIGRATE_ISOLATE] to free_list[MIGRATE_ISOLATE].
>
> This patch removes the unnecessary freepage_migratetype check and the
> redundant page moving.
>
> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
With great hope that Joonsoo won't find another corner case J
Acked-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/page_isolation.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index c8778f7..6e5174d 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -221,23 +221,8 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> continue;
> }
> page = pfn_to_page(pfn);
> - if (PageBuddy(page)) {
> - /*
> - * If race between isolatation and allocation happens,
> - * some free pages could be in MIGRATE_MOVABLE list
> - * although pageblock's migratation type of the page
> - * is MIGRATE_ISOLATE. Catch it and move the page into
> - * MIGRATE_ISOLATE list.
> - */
> - if (get_freepage_migratetype(page) != MIGRATE_ISOLATE) {
> - struct page *end_page;
> -
> - end_page = page + (1 << page_order(page)) - 1;
> - move_freepages(page_zone(page), page, end_page,
> - MIGRATE_ISOLATE);
> - }
> + if (PageBuddy(page))
> pfn += 1 << page_order(page);
> - }
> else if (page_count(page) == 0 &&
> get_freepage_migratetype(page) == MIGRATE_ISOLATE)
> pfn += 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>
WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: Weijie Yang <weijie.yang@samsung.com>, iamjoonsoo.kim@lge.com
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
mgorman@suse.de, "'Rik van Riel'" <riel@redhat.com>,
"'Johannes Weiner'" <hannes@cmpxchg.org>,
"'Minchan Kim'" <minchan@kernel.org>,
"'Weijie Yang'" <weijie.yang.kh@gmail.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: page_isolation: remove redundant moving for isolated buddy pages
Date: Tue, 09 Dec 2014 10:14:45 +0100 [thread overview]
Message-ID: <5486BD85.1010903@suse.cz> (raw)
In-Reply-To: <000101d01384$fac61240$f05236c0$%yang@samsung.com>
On 12/09/2014 08:50 AM, Weijie Yang wrote:
> The commit ad53f92e(fix incorrect isolation behavior by rechecking migratetype)
> patch series describe the race between page isolation and alloc/free path, and
> fix the race.
>
> Now, after the pageblock has been isolated, free buddy pages are already in
> the free_list[MIGRATE_ISOLATE] and will not be allocated for usage. So the
> current freepage_migratetype check is unnecessary and it will cause redundant
> page move. That is to say, even if the buddy page's migratetype is not
> MIGRATE_ISOLATE, the page is in free_list[MIGRATE_ISOLATE], we just move it
> from free_list[MIGRATE_ISOLATE] to free_list[MIGRATE_ISOLATE].
>
> This patch removes the unnecessary freepage_migratetype check and the
> redundant page moving.
>
> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
With great hope that Joonsoo won't find another corner case J
Acked-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/page_isolation.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index c8778f7..6e5174d 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -221,23 +221,8 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> continue;
> }
> page = pfn_to_page(pfn);
> - if (PageBuddy(page)) {
> - /*
> - * If race between isolatation and allocation happens,
> - * some free pages could be in MIGRATE_MOVABLE list
> - * although pageblock's migratation type of the page
> - * is MIGRATE_ISOLATE. Catch it and move the page into
> - * MIGRATE_ISOLATE list.
> - */
> - if (get_freepage_migratetype(page) != MIGRATE_ISOLATE) {
> - struct page *end_page;
> -
> - end_page = page + (1 << page_order(page)) - 1;
> - move_freepages(page_zone(page), page, end_page,
> - MIGRATE_ISOLATE);
> - }
> + if (PageBuddy(page))
> pfn += 1 << page_order(page);
> - }
> else if (page_count(page) == 0 &&
> get_freepage_migratetype(page) == MIGRATE_ISOLATE)
> pfn += 1;
>
next prev parent reply other threads:[~2014-12-09 9:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 7:50 [PATCH 1/3] mm: page_isolation: remove redundant moving for isolated buddy pages Weijie Yang
2014-12-09 7:50 ` Weijie Yang
2014-12-09 9:14 ` Vlastimil Babka [this message]
2014-12-09 9:14 ` Vlastimil Babka
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=5486BD85.1010903@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--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=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=weijie.yang.kh@gmail.com \
--cc=weijie.yang@samsung.com \
/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.