From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049Ab3BROqb (ORCPT ); Mon, 18 Feb 2013 09:46:31 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60991 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852Ab3BROq3 (ORCPT ); Mon, 18 Feb 2013 09:46:29 -0500 Date: Mon, 18 Feb 2013 14:46:23 +0000 From: Mel Gorman To: Linus Torvalds Cc: Ingo Molnar , Yinghai Lu , Greg Kroah-Hartman , Thomas Gleixner , Linux Kernel Mailing List , Jens Axboe , Alexander Viro , "Theodore Ts'o" , "H. Peter Anvin" , Laura Abbott Subject: Re: [-rc7 regression] Buggy commit: "mm: use aligned zone start for pfn_to_bitidx calculation" Message-ID: <20130218142440.GA29814@suse.de> References: <20130213111007.GA11367@gmail.com> <20130214144510.GC25282@gmail.com> <20130214145424.GA26071@gmail.com> <20130214150810.GA26095@gmail.com> <20130215114425.GD26955@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 16, 2013 at 10:26:30AM -0800, Linus Torvalds wrote: > On Fri, Feb 15, 2013 at 3:44 AM, Ingo Molnar wrote: > >> > >> c060f943d092 may be related as you config does not have > >> CONFIG_SPARSEMEM defined. > > > > Right, that's the commit causing the x86 regression: > > > > c060f943d0929f3e429c5d9522290584f6281d6e is the first bad commit > > commit c060f943d0929f3e429c5d9522290584f6281d6e > > Date: Fri Jan 11 14:31:51 2013 -0800 > > > > mm: use aligned zone start for pfn_to_bitidx calculation > > Ok, looking more at this, I don't really want to revert it, and I have > an idea of what is wrong. > > When we allocate the zone use bitmap, we do not take the > zone_start_pfn into account. So I *think* that what happens is that > "pfn_to_bitidx()" simply overruns the allocation for unaligned zonesm > and the spinlock just happens to be right after (or the overrun causes > some other memory corruption that then indirectly causes the spinlock > corruption). > More likely the latter. I'd expect the usemap to be adjacent to the zone->wait_table because of when they are allocated by the bootmem allocator. This would break wait_on_page_[locked|writeback] at the very least. If page_waitqueue() returned a corrupt pointer from the wait table then it would lead to further corruption elsewhere each time wait_on_page_foo was called. > So I'm wondering if the fix is simply something like the attached > patch. It takes the zone_start_pfn into account when allocating the > zone bitmap. > > Laura? Mel? > Looks correct to me and should cc stable@vger.kernel.org Acked-by: Mel Gorman -- Mel Gorman SUSE Labs