From: Gioh Kim <gioh.kim@lge.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>,
Laura Abbott <lauraa@codeaurora.org>,
Minchan Kim <minchan@kernel.org>,
Heesub Shin <heesub.shin@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Michal Nazarewicz <mina86@mina86.com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hui Zhu <zhuhui@xiaomi.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Ritesh Harjani <ritesh.list@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [RFC 07/16] mm/page_isolation: watch out zone range overlap
Date: Fri, 13 Feb 2015 15:40:08 +0900 [thread overview]
Message-ID: <54DD9C48.90803@lge.com> (raw)
In-Reply-To: <1423726340-4084-8-git-send-email-iamjoonsoo.kim@lge.com>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index c8778f7..883e78d 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -210,8 +210,8 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
> * Returns 1 if all pages in the range are isolated.
> */
> static int
> -__test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> - bool skip_hwpoisoned_pages)
> +__test_page_isolated_in_pageblock(struct zone *zone, unsigned long pfn,
> + unsigned long end_pfn, bool skip_hwpoisoned_pages)
> {
> struct page *page;
>
> @@ -221,6 +221,9 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> continue;
> }
> page = pfn_to_page(pfn);
> + if (page_zone(page) != zone)
> + break;
> +
> if (PageBuddy(page)) {
> /*
> * If race between isolatation and allocation happens,
> @@ -281,7 +284,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
> /* Check all pages are free or marked as ISOLATED */
> zone = page_zone(page);
> spin_lock_irqsave(&zone->lock, flags);
> - ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
> + ret = __test_page_isolated_in_pageblock(zone, start_pfn, end_pfn,
> skip_hwpoisoned_pages);
> spin_unlock_irqrestore(&zone->lock, flags);
> return ret ? 0 : -EBUSY;
>
What about checking zone at test_pages_isolated?
It might be a little bit early and without locking zone.
@@ -273,8 +273,14 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
* are not aligned to pageblock_nr_pages.
* Then we just check migratetype first.
*/
+
+ zone = page_zone(__first_valid_page(start_pfn, pageblock_nr_pages));
+
for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
page = __first_valid_page(pfn, pageblock_nr_pages);
+
+ if (page_zone(page) != zone)
+ break;
if (page && get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
break;
}
--
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: Gioh Kim <gioh.kim@lge.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Mel Gorman <mgorman@suse.de>,
Laura Abbott <lauraa@codeaurora.org>,
Minchan Kim <minchan@kernel.org>,
Heesub Shin <heesub.shin@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Michal Nazarewicz <mina86@mina86.com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hui Zhu <zhuhui@xiaomi.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Ritesh Harjani <ritesh.list@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [RFC 07/16] mm/page_isolation: watch out zone range overlap
Date: Fri, 13 Feb 2015 15:40:08 +0900 [thread overview]
Message-ID: <54DD9C48.90803@lge.com> (raw)
In-Reply-To: <1423726340-4084-8-git-send-email-iamjoonsoo.kim@lge.com>
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index c8778f7..883e78d 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -210,8 +210,8 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
> * Returns 1 if all pages in the range are isolated.
> */
> static int
> -__test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> - bool skip_hwpoisoned_pages)
> +__test_page_isolated_in_pageblock(struct zone *zone, unsigned long pfn,
> + unsigned long end_pfn, bool skip_hwpoisoned_pages)
> {
> struct page *page;
>
> @@ -221,6 +221,9 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
> continue;
> }
> page = pfn_to_page(pfn);
> + if (page_zone(page) != zone)
> + break;
> +
> if (PageBuddy(page)) {
> /*
> * If race between isolatation and allocation happens,
> @@ -281,7 +284,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
> /* Check all pages are free or marked as ISOLATED */
> zone = page_zone(page);
> spin_lock_irqsave(&zone->lock, flags);
> - ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
> + ret = __test_page_isolated_in_pageblock(zone, start_pfn, end_pfn,
> skip_hwpoisoned_pages);
> spin_unlock_irqrestore(&zone->lock, flags);
> return ret ? 0 : -EBUSY;
>
What about checking zone at test_pages_isolated?
It might be a little bit early and without locking zone.
@@ -273,8 +273,14 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
* are not aligned to pageblock_nr_pages.
* Then we just check migratetype first.
*/
+
+ zone = page_zone(__first_valid_page(start_pfn, pageblock_nr_pages));
+
for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
page = __first_valid_page(pfn, pageblock_nr_pages);
+
+ if (page_zone(page) != zone)
+ break;
if (page && get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
break;
}
next prev parent reply other threads:[~2015-02-13 6:40 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 7:32 [RFC 00/16] Introduce ZONE_CMA Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 01/16] mm/page_alloc: correct highmem memory statistics Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 02/16] mm/writeback: correct dirty page calculation for highmem Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 03/16] mm/highmem: make nr_free_highpages() handles all highmem zones by itself Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 04/16] mm/vmstat: make node_page_state() handles all " Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 05/16] mm/vmstat: watch out zone range overlap Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 06/16] mm/page_alloc: " Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 07/16] mm/page_isolation: " Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-13 6:40 ` Gioh Kim [this message]
2015-02-13 6:40 ` Gioh Kim
2015-02-17 5:24 ` Joonsoo Kim
2015-02-17 5:24 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 08/16] power: " Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 09/16] mm/cma: introduce cma_total_pages() for future use Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 10/16] mm/highmem: remove is_highmem_idx() Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 11/16] mm/page_alloc: clean-up free_area_init_core() Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 12/16] mm/cma: introduce new zone, ZONE_CMA Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 13/16] mm/cma: populate ZONE_CMA and use this zone when GFP_HIGHUSERMOVABLE Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-14 5:02 ` Gioh Kim
2015-02-14 5:02 ` Gioh Kim
2015-02-17 5:25 ` Joonsoo Kim
2015-02-17 5:25 ` Joonsoo Kim
2015-03-03 8:28 ` Aneesh Kumar K.V
2015-03-03 8:28 ` Aneesh Kumar K.V
2015-03-06 7:13 ` Joonsoo Kim
2015-03-06 7:13 ` Joonsoo Kim
2015-03-18 10:03 ` Aneesh Kumar K.V
2015-03-18 10:03 ` Aneesh Kumar K.V
2015-03-20 4:28 ` Joonsoo Kim
2015-03-20 4:28 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 14/16] mm/cma: print stealed page count Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 15/16] mm/cma: remove ALLOC_CMA Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-02-12 7:32 ` [RFC 16/16] mm/cma: remove MIGRATE_CMA Joonsoo Kim
2015-02-12 7:32 ` Joonsoo Kim
2015-03-05 16:53 ` [RFC 00/16] Introduce ZONE_CMA Vlastimil Babka
2015-03-05 16:53 ` Vlastimil Babka
2015-03-05 17:48 ` Vlastimil Babka
2015-03-05 17:48 ` Vlastimil Babka
2015-03-06 7:26 ` Joonsoo Kim
2015-03-06 7:26 ` Joonsoo Kim
2015-03-17 9:46 ` Aneesh Kumar K.V
2015-03-17 9:46 ` Aneesh Kumar K.V
2015-03-18 6:01 ` Joonsoo Kim
2015-03-18 6:01 ` Joonsoo Kim
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=54DD9C48.90803@lge.com \
--to=gioh.kim@lge.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=b.zolnierkie@samsung.com \
--cc=hannes@cmpxchg.org \
--cc=heesub.shin@samsung.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=lauraa@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=ritesh.list@gmail.com \
--cc=vbabka@suse.cz \
--cc=zhuhui@xiaomi.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.