From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758630AbYEMSwy (ORCPT ); Tue, 13 May 2008 14:52:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754439AbYEMSwq (ORCPT ); Tue, 13 May 2008 14:52:46 -0400 Received: from mtagate2.uk.ibm.com ([195.212.29.135]:27114 "EHLO mtagate2.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753090AbYEMSwp (ORCPT ); Tue, 13 May 2008 14:52:45 -0400 Date: Tue, 13 May 2008 20:52:42 +0200 From: Heiko Carstens To: Andrew Morton Cc: Andy Whitcroft , Dave Hansen , Gerald Schaefer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, KAMEZAWA Hiroyuki Subject: Re: memory_hotplug: always initialize pageblock bitmap. Message-ID: <20080513185242.GA6465@osiris.boeblingen.de.ibm.com> References: <20080509060609.GB9840@osiris.boeblingen.de.ibm.com> <20080509153910.6b074a30.kamezawa.hiroyu@jp.fujitsu.com> <20080510124501.GA4796@osiris.boeblingen.de.ibm.com> <20080512105500.ff89c0d3.kamezawa.hiroyu@jp.fujitsu.com> <20080512181928.cd41c055.kamezawa.hiroyu@jp.fujitsu.com> <20080513115825.GB12339@osiris.boeblingen.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080513115825.GB12339@osiris.boeblingen.de.ibm.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 13, 2008 at 01:58:25PM +0200, Heiko Carstens wrote: > From: Heiko Carstens > > 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 > Cc: Andy Whitcroft > Cc: Dave Hansen > Cc: Gerald Schaefer > Cc: KAMEZAWA Hiroyuki > Cc: Yasunori Goto > Signed-off-by: Andrew Morton > --- 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.