Skip to contentSkip to conversation

saved_max_pfn too small on a specific machine

PATCH Horms 2 participants 4 messages Mar 7, 2007 – Mar 8, 2007

lore
Share & tools
lore

Horms

author Acked-by
#0 lore raw
Quoted 10 lines · Bernhard Walle

Hello,

I has a problem with the patch "Make saved_max_pfn point to max_pfn of entire system":

On a HP rx8640 system with following memory map, the saved_max_pfn was wrong, i.e. there was memory in /proc/iomem marked as "System RAM" but above saved_max_pfn. This patch fixes the problem.

If you have a better solution, please give me some hints. Thanks!

Hi Bernard,

this seems reasonable to me.

Magnus Damm suggested to me that if this change is going to be made, then the whole chunk may as well be moved up to just after md is validated. See below:

Signature · 41 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

As only md is used to calculate saved_max_pfn it seems reasonable
to move setting saved_max_pfn to imediately after md is validated.
This shouldn't change the logic at all. And it seems to make what is 
going on a little clearer.

As suggested to me by Magnus Damm

Cc: Magnus Damm <[email protected]>
Signed-off-by: Simon Horman <[email protected]>

Index: linux-2.6/arch/ia64/kernel/efi.c
=================================--- linux-2.6.orig/arch/ia64/kernel/efi.c	2007-03-07 16:57:00.000000000 +0900
+++ linux-2.6/arch/ia64/kernel/efi.c	2007-03-07 17:00:02.000000000 +0900
@@ -971,6 +971,11 @@
 		if (!is_memory_available(md))
 			continue;
 
+#ifdef CONFIG_CRASH_DUMP
+		/* saved_max_pfn should ignore max_addr= command line arg */
+		if (saved_max_pfn < (efi_md_end(md) >> PAGE_SHIFT))
+			saved_max_pfn = (efi_md_end(md) >> PAGE_SHIFT);
+#endif
 		/*
 		 * Round ends inward to granule boundaries
 		 * Give trimmings to uncached allocator
@@ -1010,11 +1015,6 @@
 		} else
 			ae = efi_md_end(md);
 
-#ifdef CONFIG_CRASH_DUMP
-		/* saved_max_pfn should ignore max_addr= command line arg */
-		if (saved_max_pfn < (efi_md_end(md) >> PAGE_SHIFT))
-			saved_max_pfn = (efi_md_end(md) >> PAGE_SHIFT);
-#endif
 		/* keep within max_addr= and min_addr= command line arg */
 		as = max(as, min_addr);
 		ae = min(ae, max_addr);
#1 lore raw
Quoted 9 lines · Horms

As only md is used to calculate saved_max_pfn it seems reasonable to move setting saved_max_pfn to imediately after md is validated. This shouldn't change the logic at all. And it seems to make what is going on a little clearer.

As suggested to me by Magnus Damm

(as the original patch was from me)

author
#2 lore raw
In reply to Horms
Quoted 6 lines · Bernhard Walle
Quoted 5 lines · Horms

As only md is used to calculate saved_max_pfn it seems reasonable to move setting saved_max_pfn to imediately after md is validated. This shouldn't change the logic at all. And it seems to make what is going on a little clearer.

Quoted 7 lines
Quoted 4 lines

As suggested to me by Magnus Damm

(as the original patch was from me)

Thanks.

Feel free to roll this change into your patch if you like.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#3 lore raw
In reply to Horms
Quoted 12 lines · Horms
Quoted 11 lines · Bernhard Walle
Quoted 9 lines · Horms

As only md is used to calculate saved_max_pfn it seems reasonable to move setting saved_max_pfn to imediately after md is validated. This shouldn't change the logic at all. And it seems to make what is going on a little clearer.

As suggested to me by Magnus Damm

Quoted 6 lines
Quoted 2 lines

(as the original patch was from me)

Thanks.

Feel free to roll this change into your patch if you like.

Not necessary since Tony already picked the patch:
http://git.kernel.org/?p=linux/kernel/git/aegl/linux-2.6.git;a=commitdiff;h=e55fdf11f3029bcd41b1b9547ad9db12c27eea76

Regards,
Bernhard