[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080513185242.GA6465@osiris.boeblingen.de.ibm.com>
Date: Tue, 13 May 2008 20:52:42 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Whitcroft <apw@...dowen.org>,
Dave Hansen <haveblue@...ibm.com>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: memory_hotplug: always initialize pageblock bitmap.
On Tue, May 13, 2008 at 01:58:25PM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@...ibm.com>
>
> Trying to online a new memory section that was added via memory hotplug
> sometimes results in crashes when the new pages are added via __free_page.
> Reason for that is that the pageblock bitmap isn't initialized and hence
> contains random stuff. That means that get_pageblock_migratetype() returns
> also random stuff and therefore
>
> list_add(&page->lru,
> &zone->free_area[order].free_list[migratetype]);
>
> in __free_one_page() tries to do a list_add to something that isn't even
> necessarily a list.
>
> This happens since 86051ca5eaf5e560113ec7673462804c54284456
> ("mm: fix usemap initialization") which makes sure that the pageblock
> bitmap gets only initialized for pages present in a zone.
> Unfortunately for hot-added memory the zones "grow" after the memmap
> and the pageblock memmap have been initialized. Which means that the
> new pages have an unitialized bitmap.
> To solve this the calls to grow_zone_span() and grow_pgdat_span() are
> moved to __add_zone() just before the initialization happens.
>
> The patch also moves the two functions since __add_zone() is the only
> caller and I didn't want to add a forward declaration.
>
> Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>
> Cc: Andy Whitcroft <apw@...dowen.org>
> Cc: Dave Hansen <haveblue@...ibm.com>
> Cc: Gerald Schaefer <gerald.schaefer@...ibm.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> Cc: Yasunori Goto <y-goto@...fujitsu.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
Oops... the patch is tested and works for me. However it was not Signed-off
by Andrew. And in addition I forgot to add [PATCH] to the subject.
Sorry about that!
If all agree that this patch is ok it should probably also go into
-stable, since it fixes the above mentioned regression.
--
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