[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.v9c5yzm03l0zgt@mpn-glaptop>
Date: Wed, 08 Feb 2012 15:17:13 +0100
From: "Michal Nazarewicz" <mina86@...a86.com>
To: "Andrew Morton" <akpm@...ux-foundation.org>,
"Mel Gorman" <mgorman@...e.de>
Cc: Linux-MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: mm: compaction: Check for overlapping nodes during isolation for
migration
On Mon, 06 Feb 2012 10:08:41 +0100, Mel Gorman <mgorman@...e.de> wrote:
> When isolating pages for migration, migration starts at the start of a
> zone while the free scanner starts at the end of the zone. Migration
> avoids entering a new zone by never going beyond the free scanned.
> Unfortunately, in very rare cases nodes can overlap. When this happens,
> migration isolates pages without the LRU lock held, corrupting lists
> which will trigger errors in reclaim or during page free such as in the
> following oops
[...]
> The fix is straight-forward. isolate_migratepages() has to make a
> similar check to isolate_freepage to ensure that it never isolates
> pages from a zone it does not hold the LRU lock for.
>
> This was discovered in a 3.0-based kernel but it affects 3.1.x, 3.2.x
> and current mainline.
>
> Signed-off-by: Mel Gorman <mgorman@...e.de>
Acked-by: Michal Nazarewicz <mina86@...a86.com>
> Cc: <stable@...r.kernel.org>
> ---
> mm/compaction.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index bd6e739..6042644 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -330,8 +330,17 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
> continue;
> nr_scanned++;
>- /* Get the page and skip if free */
> + /*
> + * Get the page and ensure the page is within the same zone.
> + * See the comment in isolate_freepages about overlapping
> + * nodes. It is deliberate that the new zone lock is not taken
> + * as memory compaction should not move pages between nodes.
> + */
> page = pfn_to_page(low_pfn);
> + if (page_zone(page) != zone)
> + continue;
> +
> + /* Skip if free */
> if (PageBuddy(page))
> continue;
>
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn@...gle.com>--------------ooO--(_)--Ooo--
--
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