Re: [PATCH 1/5] powerpc: Remove bootmem allocator

2014-10-30 Thread Emil Medve
Hello Anton,


On 09/17/2014 07:15 AM, Anton Blanchard wrote:
 At the moment we transition from the memblock alloctor to the bootmem
 allocator. Gitting rid of the bootmem allocator removes a bunch of
 complicated code (most of which I owe the dubious honour of being
 responsible for writing).
 
 Signed-off-by: Anton Blanchard an...@samba.org
 Tested-by: Emil Medve emilian.me...@freescale.com
 ---
  arch/powerpc/Kconfig |   1 +
  arch/powerpc/include/asm/setup.h |   3 +-
  arch/powerpc/kernel/setup_32.c   |   5 +-
  arch/powerpc/kernel/setup_64.c   |   3 +-
  arch/powerpc/mm/init_32.c|   9 --
  arch/powerpc/mm/mem.c|  62 +--
  arch/powerpc/mm/numa.c   | 224 
 ++-
  arch/powerpc/mm/pgtable_32.c |   3 +-
  arch/powerpc/mm/pgtable_64.c |   6 +-
  9 files changed, 43 insertions(+), 273 deletions(-)

Any idea on how to move these patches forward?


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/5] powerpc: Remove bootmem allocator

2014-10-30 Thread Michael Ellerman
On Thu, 2014-10-30 at 01:00 -0500, Emil Medve wrote:
 On 09/17/2014 07:15 AM, Anton Blanchard wrote:
  At the moment we transition from the memblock alloctor to the bootmem
  allocator. Gitting rid of the bootmem allocator removes a bunch of
  complicated code (most of which I owe the dubious honour of being
  responsible for writing).
 
 Any idea on how to move these patches forward?

It's in my test branch and will go into next on Monday.

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/5] powerpc: Remove bootmem allocator

2014-10-30 Thread Emil Medve
Hello Michael,


On 10/30/2014 09:15 PM, Michael Ellerman wrote:
 On Thu, 2014-10-30 at 01:00 -0500, Emil Medve wrote:
 On 09/17/2014 07:15 AM, Anton Blanchard wrote:
 At the moment we transition from the memblock alloctor to the bootmem
 allocator. Gitting rid of the bootmem allocator removes a bunch of
 complicated code (most of which I owe the dubious honour of being
 responsible for writing).

 Any idea on how to move these patches forward?
 
 It's in my test branch and will go into next on Monday.

Thank you


Cheers,
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/5] powerpc: Remove bootmem allocator

2014-09-17 Thread Anton Blanchard
At the moment we transition from the memblock alloctor to the bootmem
allocator. Gitting rid of the bootmem allocator removes a bunch of
complicated code (most of which I owe the dubious honour of being
responsible for writing).

Signed-off-by: Anton Blanchard an...@samba.org
Tested-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/Kconfig |   1 +
 arch/powerpc/include/asm/setup.h |   3 +-
 arch/powerpc/kernel/setup_32.c   |   5 +-
 arch/powerpc/kernel/setup_64.c   |   3 +-
 arch/powerpc/mm/init_32.c|   9 --
 arch/powerpc/mm/mem.c|  62 +--
 arch/powerpc/mm/numa.c   | 224 ++-
 arch/powerpc/mm/pgtable_32.c |   3 +-
 arch/powerpc/mm/pgtable_64.c |   6 +-
 9 files changed, 43 insertions(+), 273 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 90fe77a..3eeeb9d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -148,6 +148,7 @@ config PPC
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
select HAVE_PERF_EVENTS_NMI if PPC64
+   select NO_BOOTMEM
 
 config GENERIC_CSUM
def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 11ba86e..fbdf18c 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -8,7 +8,6 @@ extern void ppc_printk_progress(char *s, unsigned short hex);
 
 extern unsigned int rtas_data;
 extern int mem_init_done;  /* set on boot once kmalloc can be called */
-extern int init_bootmem_done;  /* set once bootmem is available */
 extern unsigned long long memory_limit;
 extern unsigned long klimit;
 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
@@ -24,7 +23,7 @@ extern void reloc_got2(unsigned long);
 #define PTRRELOC(x)((typeof(x)) add_reloc_offset((unsigned long)(x)))
 
 void check_for_initrd(void);
-void do_init_bootmem(void);
+void initmem_init(void);
 void setup_panic(void);
 #define ARCH_PANIC_TIMEOUT 180
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ea4fda6..e2bc044 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -311,9 +311,8 @@ void __init setup_arch(char **cmdline_p)
 
irqstack_early_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
-   if ( ppc_md.progress ) ppc_md.progress(setup_arch: bootmem, 0x3eab);
+   initmem_init();
+   if ( ppc_md.progress ) ppc_md.progress(setup_arch: initmem, 0x3eab);
 
 #ifdef CONFIG_DUMMY_CONSOLE
conswitchp = dummy_con;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index fa17c94..9f8f472 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -681,8 +681,7 @@ void __init setup_arch(char **cmdline_p)
exc_lvl_early_init();
emergency_stack_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
+   initmem_init();
sparse_init();
 
 #ifdef CONFIG_DUMMY_CONSOLE
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index cff59f1..9d1bde2 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -195,15 +195,6 @@ void __init MMU_init(void)
memblock_set_current_limit(lowmem_end_addr);
 }
 
-/* This is only called until mem_init is done. */
-void __init *early_get_page(void)
-{
-   if (init_bootmem_done)
-   return alloc_bootmem_pages(PAGE_SIZE);
-   else
-   return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
-}
-
 #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
 void setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index e0f7a18..aa067b7 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -60,7 +60,6 @@
 #define CPU_FTR_NOEXECUTE  0
 #endif
 
-int init_bootmem_done;
 int mem_init_done;
 unsigned long long memory_limit;
 
@@ -180,70 +179,22 @@ walk_system_ram_range(unsigned long start_pfn, unsigned 
long nr_pages,
 }
 EXPORT_SYMBOL_GPL(walk_system_ram_range);
 
-/*
- * Initialize the bootmem system and give it all the memory we
- * have available.  If we are using highmem, we only put the
- * lowmem into the bootmem system.
- */
 #ifndef CONFIG_NEED_MULTIPLE_NODES
-void __init do_init_bootmem(void)
+void __init initmem_init(void)
 {
-   unsigned long start, bootmap_pages;
-   unsigned long total_pages;
-   struct memblock_region *reg;
-   int boot_mapsize;
-
max_low_pfn = max_pfn = memblock_end_of_DRAM()  PAGE_SHIFT;
-   total_pages = (memblock_end_of_DRAM() - memstart_addr)  PAGE_SHIFT;
+   min_low_pfn = MEMORY_START  PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
-   total_pages = total_lowmem  PAGE_SHIFT;
max_low_pfn = 

[PATCH 1/5] powerpc: Remove bootmem allocator

2014-09-16 Thread Anton Blanchard
At the moment we transition from the memblock alloctor to the bootmem
allocator. Gitting rid of the bootmem allocator removes a bunch of
complicated code (most of which I owe the dubious honour of being
responsible for writing).

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/Kconfig |   1 +
 arch/powerpc/include/asm/setup.h |   3 +-
 arch/powerpc/kernel/setup_32.c   |   5 +-
 arch/powerpc/kernel/setup_64.c   |   3 +-
 arch/powerpc/mm/init_32.c|   9 --
 arch/powerpc/mm/mem.c|  62 +--
 arch/powerpc/mm/numa.c   | 224 ++-
 arch/powerpc/mm/pgtable_32.c |   3 +-
 arch/powerpc/mm/pgtable_64.c |   6 +-
 9 files changed, 43 insertions(+), 273 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 90fe77a..3eeeb9d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -148,6 +148,7 @@ config PPC
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
select HAVE_PERF_EVENTS_NMI if PPC64
+   select NO_BOOTMEM
 
 config GENERIC_CSUM
def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 11ba86e..fbdf18c 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -8,7 +8,6 @@ extern void ppc_printk_progress(char *s, unsigned short hex);
 
 extern unsigned int rtas_data;
 extern int mem_init_done;  /* set on boot once kmalloc can be called */
-extern int init_bootmem_done;  /* set once bootmem is available */
 extern unsigned long long memory_limit;
 extern unsigned long klimit;
 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
@@ -24,7 +23,7 @@ extern void reloc_got2(unsigned long);
 #define PTRRELOC(x)((typeof(x)) add_reloc_offset((unsigned long)(x)))
 
 void check_for_initrd(void);
-void do_init_bootmem(void);
+void initmem_init(void);
 void setup_panic(void);
 #define ARCH_PANIC_TIMEOUT 180
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ea4fda6..e2bc044 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -311,9 +311,8 @@ void __init setup_arch(char **cmdline_p)
 
irqstack_early_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
-   if ( ppc_md.progress ) ppc_md.progress(setup_arch: bootmem, 0x3eab);
+   initmem_init();
+   if ( ppc_md.progress ) ppc_md.progress(setup_arch: initmem, 0x3eab);
 
 #ifdef CONFIG_DUMMY_CONSOLE
conswitchp = dummy_con;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index fa17c94..9f8f472 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -681,8 +681,7 @@ void __init setup_arch(char **cmdline_p)
exc_lvl_early_init();
emergency_stack_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
+   initmem_init();
sparse_init();
 
 #ifdef CONFIG_DUMMY_CONSOLE
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index cff59f1..9d1bde2 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -195,15 +195,6 @@ void __init MMU_init(void)
memblock_set_current_limit(lowmem_end_addr);
 }
 
-/* This is only called until mem_init is done. */
-void __init *early_get_page(void)
-{
-   if (init_bootmem_done)
-   return alloc_bootmem_pages(PAGE_SIZE);
-   else
-   return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
-}
-
 #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
 void setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index e0f7a18..aa067b7 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -60,7 +60,6 @@
 #define CPU_FTR_NOEXECUTE  0
 #endif
 
-int init_bootmem_done;
 int mem_init_done;
 unsigned long long memory_limit;
 
@@ -180,70 +179,22 @@ walk_system_ram_range(unsigned long start_pfn, unsigned 
long nr_pages,
 }
 EXPORT_SYMBOL_GPL(walk_system_ram_range);
 
-/*
- * Initialize the bootmem system and give it all the memory we
- * have available.  If we are using highmem, we only put the
- * lowmem into the bootmem system.
- */
 #ifndef CONFIG_NEED_MULTIPLE_NODES
-void __init do_init_bootmem(void)
+void __init initmem_init(void)
 {
-   unsigned long start, bootmap_pages;
-   unsigned long total_pages;
-   struct memblock_region *reg;
-   int boot_mapsize;
-
max_low_pfn = max_pfn = memblock_end_of_DRAM()  PAGE_SHIFT;
-   total_pages = (memblock_end_of_DRAM() - memstart_addr)  PAGE_SHIFT;
+   min_low_pfn = MEMORY_START  PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
-   total_pages = total_lowmem  PAGE_SHIFT;
max_low_pfn = lowmem_end_addr  PAGE_SHIFT;
 #endif
 
-   /*
-   

[PATCH 1/5] powerpc: Remove bootmem allocator

2014-08-05 Thread Anton Blanchard
At the moment we transition from the memblock alloctor to the bootmem
allocator. Removing the bootmem allocator removes a bunch of complicated
code (most of which I owe the dubious honour of being responsible for
writing).

Signed-off-by: Anton Blanchard an...@samba.org
---

Index: b/arch/powerpc/Kconfig
===
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -145,6 +145,7 @@ config PPC
select HAVE_IRQ_EXIT_ON_IRQ_STACK
select ARCH_USE_CMPXCHG_LOCKREF if PPC64
select HAVE_ARCH_AUDITSYSCALL
+   select NO_BOOTMEM
 
 config GENERIC_CSUM
def_bool CPU_LITTLE_ENDIAN
Index: b/arch/powerpc/include/asm/setup.h
===
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -8,7 +8,6 @@ extern void ppc_printk_progress(char *s,
 
 extern unsigned int rtas_data;
 extern int mem_init_done;  /* set on boot once kmalloc can be called */
-extern int init_bootmem_done;  /* set once bootmem is available */
 extern unsigned long long memory_limit;
 extern unsigned long klimit;
 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
@@ -24,7 +23,7 @@ extern void reloc_got2(unsigned long);
 #define PTRRELOC(x)((typeof(x)) add_reloc_offset((unsigned long)(x)))
 
 void check_for_initrd(void);
-void do_init_bootmem(void);
+void initmem_init(void);
 void setup_panic(void);
 #define ARCH_PANIC_TIMEOUT 180
 
Index: b/arch/powerpc/kernel/setup_32.c
===
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -311,9 +311,8 @@ void __init setup_arch(char **cmdline_p)
 
irqstack_early_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
-   if ( ppc_md.progress ) ppc_md.progress(setup_arch: bootmem, 0x3eab);
+   initmem_init();
+   if ( ppc_md.progress ) ppc_md.progress(setup_arch: initmem, 0x3eab);
 
 #ifdef CONFIG_DUMMY_CONSOLE
conswitchp = dummy_con;
Index: b/arch/powerpc/kernel/setup_64.c
===
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -677,8 +677,7 @@ void __init setup_arch(char **cmdline_p)
exc_lvl_early_init();
emergency_stack_init();
 
-   /* set up the bootmem stuff with available memory */
-   do_init_bootmem();
+   initmem_init();
sparse_init();
 
 #ifdef CONFIG_DUMMY_CONSOLE
Index: b/arch/powerpc/mm/init_32.c
===
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -195,15 +195,6 @@ void __init MMU_init(void)
memblock_set_current_limit(lowmem_end_addr);
 }
 
-/* This is only called until mem_init is done. */
-void __init *early_get_page(void)
-{
-   if (init_bootmem_done)
-   return alloc_bootmem_pages(PAGE_SIZE);
-   else
-   return __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
-}
-
 #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
 void setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size)
Index: b/arch/powerpc/mm/mem.c
===
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -60,7 +60,6 @@
 #define CPU_FTR_NOEXECUTE  0
 #endif
 
-int init_bootmem_done;
 int mem_init_done;
 unsigned long long memory_limit;
 
@@ -179,70 +178,22 @@ walk_system_ram_range(unsigned long star
 }
 EXPORT_SYMBOL_GPL(walk_system_ram_range);
 
-/*
- * Initialize the bootmem system and give it all the memory we
- * have available.  If we are using highmem, we only put the
- * lowmem into the bootmem system.
- */
 #ifndef CONFIG_NEED_MULTIPLE_NODES
-void __init do_init_bootmem(void)
+void __init initmem_init(void)
 {
-   unsigned long start, bootmap_pages;
-   unsigned long total_pages;
-   struct memblock_region *reg;
-   int boot_mapsize;
-
max_low_pfn = max_pfn = memblock_end_of_DRAM()  PAGE_SHIFT;
-   total_pages = (memblock_end_of_DRAM() - memstart_addr)  PAGE_SHIFT;
+   min_low_pfn = MEMORY_START  PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
-   total_pages = total_lowmem  PAGE_SHIFT;
max_low_pfn = lowmem_end_addr  PAGE_SHIFT;
 #endif
 
-   /*
-* Find an area to use for the bootmem bitmap.  Calculate the size of
-* bitmap required as (Total Memory) / PAGE_SIZE / BITS_PER_BYTE.
-* Add 1 additional page in case the address isn't page-aligned.
-*/
-   bootmap_pages = bootmem_bootmap_pages(total_pages);
-
-   start = memblock_alloc(bootmap_pages  PAGE_SHIFT, PAGE_SIZE);
-
-   min_low_pfn = MEMORY_START  PAGE_SHIFT;
-   boot_mapsize = init_bootmem_node(NODE_DATA(0), start  PAGE_SHIFT, 
min_low_pfn,