Skip to contentSkip to conversation

sparc64: Fix array size reported by vmemmap_populate()

PATCH In review Ben Hutchings 2 participants 3 messages Apr 3, 2010 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: Fix array size reported by vmemmap_populate()

vmemmap_populate() attempts to report the used index and total size of vmemmap_table, but it wrongly shifts the total size so that it is always shown as 0.

---
 arch/sparc/mm/init_64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sparc/mm/init_64.c +1 -1
index aaebc48..b2831dc 100644
@@ -2117,7 +2117,7 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
 			       "node=%d entry=%lu/%lu\n", start, block, nr,
 			       node,
 			       addr >> VMEMMAP_CHUNK_SHIFT,
-			       VMEMMAP_SIZE >> VMEMMAP_CHUNK_SHIFT);
+			       VMEMMAP_SIZE);
 		}
 	}
 	return 0;
Signature · 1 line
1.7.0.3
maintainer
#1 lore raw

From: Ben Hutchings <[email protected]>
Date: Sat, 03 Apr 2010 21:41:20 +0100

Quoted 5 lines

vmemmap_populate() attempts to report the used index and total size of vmemmap_table, but it wrongly shifts the total size so that it is always shown as 0.

It's not the total, size, it's the total number of chunks that the area supports.

So it's trying to say:

	entry=${NUM_CHUNKS}/${MAX_CHUNKS}

So I think the printk statement is correct and if you check you'll find that every other vmemmap supporting platform has this same printk statement.

maintainer
#2 lore raw
In reply to Ben Hutchings

From: David Miller <[email protected]>
Date: Sat, 03 Apr 2010 13:50:29 -0700 (PDT)

Quoted 11 lines

From: Ben Hutchings <[email protected]>
Date: Sat, 03 Apr 2010 21:41:20 +0100

Quoted 5 lines

vmemmap_populate() attempts to report the used index and total size of vmemmap_table, but it wrongly shifts the total size so that it is always shown as 0.

It's not the total, size, it's the total number of chunks that the area supports.

Nevermind, Ben's patch is right, I'll apply it.

VMEMMAP_SIZE is number of entries, not a size in bytes.

Further confusing things is that before the VMEMMAP_SIZE bug fix the other month, the calculation was "correct" :-)