LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] UV: memory allocation at initialization
@ 2008-10-23 22:54 Cliff Wickman
  2008-10-27 13:17 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Cliff Wickman @ 2008-10-23 22:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo



From: Cliff Wickman <cpw@sgi.com>

UV initialization is currently called too late to call alloc_bootmem_pages().
The current sequence is:

 start_kernel()
   mem_init()
     free_all_bootmem()           <--- discard of bootmem
   rest_init()
     kernel_init()
       smp_prepare_cpus()
       native_smp_prepare_cpus()
         uv_system_init()         <--- uses alloc_bootmem_pages()

It should be calling kmalloc().

Diffed against 2.6.27 (linux-next)

Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 arch/x86/kernel/genx2apic_uv_x.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux/arch/x86/kernel/genx2apic_uv_x.c
===================================================================
--- linux.orig/arch/x86/kernel/genx2apic_uv_x.c
+++ linux/arch/x86/kernel/genx2apic_uv_x.c
@@ -15,7 +15,6 @@
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/bootmem.h>
 #include <linux/module.h>
 #include <linux/hardirq.h>
 #include <asm/smp.h>
@@ -407,16 +406,16 @@ void __init uv_system_init(void)
 	printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades());
 
 	bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades();
-	uv_blade_info = alloc_bootmem_pages(bytes);
+	uv_blade_info = kmalloc(bytes, GFP_KERNEL);
 
 	get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size);
 
 	bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes();
-	uv_node_to_blade = alloc_bootmem_pages(bytes);
+	uv_node_to_blade = kmalloc(bytes, GFP_KERNEL);
 	memset(uv_node_to_blade, 255, bytes);
 
 	bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus();
-	uv_cpu_to_blade = alloc_bootmem_pages(bytes);
+	uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL);
 	memset(uv_cpu_to_blade, 255, bytes);
 
 	blade = 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] UV: memory allocation at initialization
  2008-10-23 22:54 [PATCH] UV: memory allocation at initialization Cliff Wickman
@ 2008-10-27 13:17 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-10-27 13:17 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin


* Cliff Wickman <cpw@sgi.com> wrote:

> From: Cliff Wickman <cpw@sgi.com>
> 
> UV initialization is currently called too late to call alloc_bootmem_pages().
> The current sequence is:
> 
>  start_kernel()
>    mem_init()
>      free_all_bootmem()           <--- discard of bootmem
>    rest_init()
>      kernel_init()
>        smp_prepare_cpus()
>        native_smp_prepare_cpus()
>          uv_system_init()         <--- uses alloc_bootmem_pages()
> 
> It should be calling kmalloc().
> 
> Diffed against 2.6.27 (linux-next)
> 
> Signed-off-by: Cliff Wickman <cpw@sgi.com>
> ---
>  arch/x86/kernel/genx2apic_uv_x.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

applied to tip/x86/urgent, thanks Cliff!

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-27 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-23 22:54 [PATCH] UV: memory allocation at initialization Cliff Wickman
2008-10-27 13:17 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).