* [PATCH 1/8] alpha: mem_map/max_mapnr -- init is FLATMEM use correct defines
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
@ 2008-04-10 10:40 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 2/8] arm: " Andy Whitcroft
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:40 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The alpha init.c implementation of mem_init is specifically a FLATMEM
implementation, use the correct config option.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/alpha/mm/init.c | 4 ++--
include/asm-alpha/mmzone.h | 2 --
include/asm-alpha/pgtable.h | 4 ++--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 234e42b..9a4e669 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -277,7 +277,7 @@ srm_paging_stop (void)
}
#endif
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
static void __init
printk_memory_info(void)
{
@@ -317,7 +317,7 @@ mem_init(void)
printk_memory_info();
}
-#endif /* CONFIG_DISCONTIGMEM */
+#endif /* CONFIG_FLATMEM */
void
free_reserved_mem(void *start, void *end)
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index 8af56ce..8bfb3b2 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -72,8 +72,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-#define VALID_PAGE(page) (((page) - mem_map) < max_mapnr)
-
#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> 32))
#define pgd_page(pgd) (pfn_to_page(pgd_val(pgd) >> 32))
#define pte_pfn(pte) (pte_val(pte) >> 32)
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 99037b0..665ba5c 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -202,7 +202,7 @@ extern unsigned long __zero_page(void);
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*/
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
#define page_to_pa(page) (((page) - mem_map) << PAGE_SHIFT)
#define pte_pfn(pte) (pte_val(pte) >> 32)
@@ -235,7 +235,7 @@ pmd_page_vaddr(pmd_t pmd)
return ((pmd_val(pmd) & _PFN_MASK) >> (32-PAGE_SHIFT)) + PAGE_OFFSET;
}
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
#define pmd_page(pmd) (mem_map + ((pmd_val(pmd) & _PFN_MASK) >> 32))
#define pgd_page(pgd) (mem_map + ((pgd_val(pgd) & _PFN_MASK) >> 32))
#endif
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/8] arm: mem_map/max_mapnr -- init is FLATMEM use correct defines
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
2008-04-10 10:40 ` [PATCH 1/8] alpha: mem_map/max_mapnr -- init is FLATMEM use correct defines Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 3/8] m32r: mem_map/max_mapnr -- definition is specific to FLATMEM Andy Whitcroft
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The initialisation of max_mapnr is only valid if the memory
model is FLATMEM, use the appropriate define.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/arm/mm/init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index b657f17..e414e83 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -426,7 +426,7 @@ void __init mem_init(void)
datapages = &_end - &__data_start;
initpages = &__init_end - &__init_begin;
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
max_mapnr = virt_to_page(high_memory) - mem_map;
#endif
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/8] m32r: mem_map/max_mapnr -- definition is specific to FLATMEM
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
2008-04-10 10:40 ` [PATCH 1/8] alpha: mem_map/max_mapnr -- init is FLATMEM use correct defines Andy Whitcroft
2008-04-10 10:41 ` [PATCH 2/8] arm: " Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 4/8] mips: " Andy Whitcroft
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The max_mapnr variable is only used FLATMEM memory model, use the
appropriate defines.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/m32r/mm/init.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 2a3e8b5..f4a614f 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -148,9 +148,9 @@ void __init mem_init(void)
num_physpages -= hole_pages;
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
max_mapnr = num_physpages;
-#endif /* CONFIG_DISCONTIGMEM */
+#endif /* CONFIG_FLATMEM */
#ifdef CONFIG_MMU
high_memory = (void *)__va(PFN_PHYS(MAX_LOW_PFN(0)));
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/8] mips: mem_map/max_mapnr -- definition is specific to FLATMEM
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
` (2 preceding siblings ...)
2008-04-10 10:41 ` [PATCH 3/8] m32r: mem_map/max_mapnr -- definition is specific to FLATMEM Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 5/8] parisc: " Andy Whitcroft
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The max_mapnr variable is only used FLATMEM memory model, use the
appropriate defines.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/mips/mm/init.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index c7aed13..68c90b5 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -389,19 +389,22 @@ static struct kcore_list kcore_mem, kcore_vmalloc;
static struct kcore_list kcore_kseg0;
#endif
+#if defined(CONFIG_HIGHMEM) && defined(CONFIG_DISCONTIGMEM)
+#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
+#endif
+
void __init mem_init(void)
{
unsigned long codesize, reservedpages, datasize, initsize;
unsigned long tmp, ram;
+#ifdef CONFIG_FLATMEM
#ifdef CONFIG_HIGHMEM
-#ifdef CONFIG_DISCONTIGMEM
-#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
-#endif
max_mapnr = highend_pfn;
#else
max_mapnr = max_low_pfn;
#endif
+#endif
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
totalram_pages += free_all_bootmem();
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 5/8] parisc: mem_map/max_mapnr -- definition is specific to FLATMEM
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
` (3 preceding siblings ...)
2008-04-10 10:41 ` [PATCH 4/8] mips: " Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 6/8] powerpc: " Andy Whitcroft
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The max_mapnr variable is only used FLATMEM memory model, use the
appropriate defines.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/parisc/mm/init.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 2c721e1..bd300d1 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -461,10 +461,11 @@ void __init mem_init(void)
high_memory = __va((max_pfn << PAGE_SHIFT));
-#ifndef CONFIG_DISCONTIGMEM
+#ifdef CONFIG_FLATMEM
max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
totalram_pages += free_all_bootmem();
-#else
+#endif
+#ifdef CONFIG_DISCONTIGMEM
{
int i;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/8] powerpc: mem_map/max_mapnr -- definition is specific to FLATMEM
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
` (4 preceding siblings ...)
2008-04-10 10:41 ` [PATCH 5/8] parisc: " Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 7/8] sparc64: " Andy Whitcroft
2008-04-10 10:41 ` [PATCH 8/8] mem_map/max_mapnr are specific to the FLATMEM memory model Andy Whitcroft
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The max_mapnr variable is only used FLATMEM memory model, use the
appropriate defines. Note that HIGHMEM is only valid on PPC32, and that
only supports FLATMEM.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/powerpc/mm/mem.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fcbae37..09d275e 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -319,9 +319,11 @@ void __init mem_init(void)
}
}
#else
- max_mapnr = max_pfn;
totalram_pages += free_all_bootmem();
#endif
+#ifdef CONFIG_FLATMEM
+ max_mapnr = max_pfn;
+#endif
for_each_online_pgdat(pgdat) {
for (i = 0; i < pgdat->node_spanned_pages; i++) {
if (!pfn_valid(pgdat->node_start_pfn + i))
@@ -337,7 +339,7 @@ void __init mem_init(void)
initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
-#ifdef CONFIG_HIGHMEM
+#if defined(CONFIG_FLATMEM) && defined(CONFIG_HIGHMEM)
{
unsigned long pfn, highmem_mapnr;
@@ -356,7 +358,7 @@ void __init mem_init(void)
printk(KERN_DEBUG "High memory: %luk\n",
totalhigh_pages << (PAGE_SHIFT-10));
}
-#endif /* CONFIG_HIGHMEM */
+#endif /* CONFIG_FLATMEM/CONFIG_HIGHMEM */
printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
"%luk reserved, %luk data, %luk bss, %luk init)\n",
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 7/8] sparc64: mem_map/max_mapnr -- definition is specific to FLATMEM
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
` (5 preceding siblings ...)
2008-04-10 10:41 ` [PATCH 6/8] powerpc: " Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-04-10 10:41 ` [PATCH 8/8] mem_map/max_mapnr are specific to the FLATMEM memory model Andy Whitcroft
7 siblings, 0 replies; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
The max_mapnr variable is only used FLATMEM memory model, as sparc64
only supports SPARSEMEM this variable is redundant.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
arch/sparc64/mm/init.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index f6a86a2..c218134 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -1330,8 +1330,6 @@ void __init paging_init(void)
pages_avail = 0;
last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base);
- max_mapnr = last_valid_pfn;
-
kernel_physical_mapping_init();
real_setup_per_cpu_areas();
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 8/8] mem_map/max_mapnr are specific to the FLATMEM memory model
2008-04-10 10:33 ` max_mapnr config option Andy Whitcroft
` (6 preceding siblings ...)
2008-04-10 10:41 ` [PATCH 7/8] sparc64: " Andy Whitcroft
@ 2008-04-10 10:41 ` Andy Whitcroft
2008-06-02 15:13 ` Jeremy Fitzhardinge
7 siblings, 1 reply; 12+ messages in thread
From: Andy Whitcroft @ 2008-04-10 10:41 UTC (permalink / raw)
To: Dave Hansen
Cc: Jeremy Fitzhardinge, Johannes Weiner, Andy Whitcroft, linux-mm
mem_map and max_mapnr are variables used in the FLATMEM memory model
only. Ensure they are only defined when that memory model is enabled.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
mm/memory.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 0d14d1e..091324e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -61,8 +61,7 @@
#include <linux/swapops.h>
#include <linux/elf.h>
-#ifndef CONFIG_NEED_MULTIPLE_NODES
-/* use the per-pgdat data instead for discontigmem - mbligh */
+#ifdef CONFIG_FLATMEM
unsigned long max_mapnr;
struct page *mem_map;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 8/8] mem_map/max_mapnr are specific to the FLATMEM memory model
2008-04-10 10:41 ` [PATCH 8/8] mem_map/max_mapnr are specific to the FLATMEM memory model Andy Whitcroft
@ 2008-06-02 15:13 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 12+ messages in thread
From: Jeremy Fitzhardinge @ 2008-06-02 15:13 UTC (permalink / raw)
To: Andy Whitcroft; +Cc: Dave Hansen, Johannes Weiner, linux-mm
Andy Whitcroft wrote:
> mem_map and max_mapnr are variables used in the FLATMEM memory model
> only. Ensure they are only defined when that memory model is enabled.
>
Is this series queued to be applied?
BTW, how does max_mapnr differ from x86-64's end_pfn?
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>
> ---
> mm/memory.c | 3 +--
>
I think you need to fix the declaration in linux/mm.h as well.
> 1 files changed, 1 insertions(+), 2 deletions(-)
> diff --git a/mm/memory.c b/mm/memory.c
> index 0d14d1e..091324e 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -61,8 +61,7 @@
> #include <linux/swapops.h>
> #include <linux/elf.h>
>
> -#ifndef CONFIG_NEED_MULTIPLE_NODES
> -/* use the per-pgdat data instead for discontigmem - mbligh */
> +#ifdef CONFIG_FLATMEM
> unsigned long max_mapnr;
> struct page *mem_map;
>
>
Thanks,
J
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 12+ messages in thread