Re: 2.6.23-rc1-mm2

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Torsten Kaiser <just.for.lkml@...>
Cc: Mel Gorman <mel@...>, Andrew Morton <akpm@...>, <Valdis.Kletnieks@...>, <linux-kernel@...>
Date: Thursday, August 2, 2007 - 10:01 am

On Thu, Aug 02, 2007 at 12:40:59AM +0100, Mel Gorman wrote:

This implies that &page->lru is invalid.  Which implies that the memory
map is indeed not present.  However, if we look at the code in detail we
have actually already updated several fields in the struct page already.
Particularly we have already updated the flags, _count, and _mapcount.
It is when we touch lru which we blammo.  All of the good entries are in
the first 24 bytes of the struct page, lru is in the 8th 64bit word, or
+64 bytes.  Looking at the faulting address it is ffffe20003000010, ie
the fault is 16 bytes into a page.  So the first three elements of this
struct page are in one PMD mapped page, and the lru the next.

As this has SPARSEMEM_VMEMMAP enabled that implies that the vemmmap has
not been filled out correctly.  Looking at the x86_64 initialiser it
appears that we have the same bug that Kame-san reported against the
generic initialisers.  At the end of this email is a proposed patch for
this, could you apply that to a clean 2.6.23-rc1-mm2 tree and give it
a test for me.  I have boot tested this on our x86_64 boxes, but they
happen to be sized and layed out to not trip this bug.

Let me know if it fixes things up for you and I will push it upstream.
If this patch does not fix it could you please get us a boot log at
loglevel=8 of an unmodified 2.6.23-rc1-mm2 kernel, this should give
sufficient debug on how the vmemmap is initialised.

[...]

-apw

=== 8< ===
vmemmap x86_64: ensure end of section memmap is initialised

Similar to the generic initialisers, the x86_64 vmemmap
initialisation may incorrectly skip the last page of a section if
the section start is not aligned to the page.

Where we have a section spanning the end of a PMD we will check the
start of the section at A populating it.  We will then move on 1
PMD page to C and find ourselves beyond the end of the section which
ends at B we will complete without checking the second PMD page.

        |     PMD     |     PMD     |
                 | SECTION |
                 A         B   C

We should round ourselves to the end of the PMD as we iterate.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
 arch/x86_64/mm/init.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index ac49df0..5d1ed03 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -792,9 +792,10 @@ int __meminit vmemmap_populate_pmd(pud_t *pud, unsigned long addr,
 						unsigned long end, int node)
 {
 	pmd_t *pmd;
+	unsigned long next;
 
-	for (pmd = pmd_offset(pud, addr); addr < end;
-						pmd++, addr += PMD_SIZE)
+	for (pmd = pmd_offset(pud, addr); addr < end; pmd++, addr = next) {
+		next = pmd_addr_end(addr, end);
 		if (pmd_none(*pmd)) {
 			pte_t entry;
 			void *p = vmemmap_alloc_block(PMD_SIZE, node);
@@ -808,8 +809,8 @@ int __meminit vmemmap_populate_pmd(pud_t *pud, unsigned long addr,
 			printk(KERN_DEBUG " [%lx-%lx] PMD ->%p on node %d\n",
 				addr, addr + PMD_SIZE - 1, p, node);
 		} else
-			vmemmap_verify((pte_t *)pmd, node,
-						pmd_addr_end(addr, end), end);
+			vmemmap_verify((pte_t *)pmd, node, next, end);
+	}
 	return 0;
 }
 #endif
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 2:09 am)
[-mm patch] make pm3fb_init() static again, Adrian Bunk, (Tue Aug 14, 5:21 pm)
2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Adrian Bunk, (Wed Aug 8, 5:31 pm)
Re: 2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Pierre Ossman, (Thu Aug 9, 8:03 am)
Re: 2.6.23-rc1-mm2, Marc Dietrich, (Fri Aug 3, 7:00 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Fri Aug 3, 12:38 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Fri Aug 3, 1:03 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Fri Aug 3, 1:21 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 5:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 5:37 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 6:05 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 6:20 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 7:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 7:14 pm)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 2:24 am)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Mon Aug 6, 7:05 am)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Mon Aug 6, 12:24 pm)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Tue Aug 7, 8:09 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 7:13 am)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Mon Aug 6, 6:53 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 6:58 am)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Rafael J. Wysocki, (Thu Aug 2, 1:31 pm)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Eric W. Biederman, (Thu Aug 2, 2:19 pm)
[PATCH -mm] linux-audit list is subscribers-only , Gabriel C, (Wed Aug 1, 7:59 pm)
Re: [PATCH -mm] linux-audit list is subscribers-only, Randy Dunlap, (Wed Aug 1, 9:30 pm)
INOTIFY=n , AUDIT*=y compile error, Gabriel C, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, , (Wed Aug 1, 4:30 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:40 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Wed Aug 1, 4:52 pm)
Re: 2.6.23-rc1-mm2, Mel Gorman, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, Andy Whitcroft, (Thu Aug 2, 10:01 am)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 1:44 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 12:38 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 5:17 pm)
[PATCH -mm] Fix a section mismatch warning, Gabriel C, (Wed Aug 1, 11:19 am)
[PATCH] fix slown down printk on boot compile error, Heiko Carstens, (Wed Aug 1, 7:16 am)
Re: [PATCH] fix slown down printk on boot compile error, Randy Dunlap, (Wed Aug 1, 12:32 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 6:56 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 1:26 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 1:39 pm)
unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 6:33 am)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Andrew Morton, (Wed Aug 1, 1:22 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 1:35 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Josef Sipek, (Wed Aug 1, 1:27 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ) , Erez Zadok, (Thu Aug 2, 12:29 pm)
[PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 5:34 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 10:43 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Michael Buesch, (Wed Aug 1, 10:54 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, John W. Linville, (Wed Aug 1, 8:24 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Wed Aug 1, 4:02 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:08 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 3:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 5:25 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 6:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 7:12 pm)
Re: 2.6.23-rc1-mm2, Greg KH, (Wed Aug 1, 12:36 pm)
Re: 2.6.23-rc1-mm2, Paul Mackerras, (Wed Aug 1, 6:32 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 6:14 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:10 pm)
Re: 2.6.23-rc1-mm2, Kumar Gala, (Fri Aug 3, 5:39 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:12 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:13 am)
Re: 2.6.23-rc1-mm2, Jiri Kosina, (Wed Aug 1, 6:23 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 5:47 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Alan Stern, (Thu Aug 2, 10:20 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 10:32 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Jiri Kosina, (Thu Aug 2, 10:26 am)
Re: 2.6.23-rc1-mm2, Ingo Molnar, (Wed Aug 1, 4:16 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 2:25 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 8:22 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 3:58 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 4:15 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 5:04 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:10 am)
Re: 2.6.23-rc1-mm2, Christoph Hellwig, (Wed Aug 1, 9:45 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 9:57 am)