public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] Gdt hotplug
@ 2005-09-28 21:44 Zachary Amsden
  2005-09-28 22:15 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Zachary Amsden @ 2005-09-28 21:44 UTC (permalink / raw)
  To: Linus Torvalds, Jeffrey Sheldon, Ole Agesen, Shai Fultheim,
	Andrew Morton, Jack Lo, Ingo Molnar, Linux Kernel Mailing List,
	Virtualization Mailing List, Chris Wright, Martin Bligh,
	Pratap Subrahmanyam, Christopher Li, H. Peter Anvin,
	Zwane Mwaikambo, Andi Kleen, Zachary Amsden

As suggested by Andi Kleen, don't allocate a GDT page if there is already one
present.  Needed for CPU hotplug.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.14-rc1/arch/i386/kernel/smpboot.c
===================================================================
--- linux-2.6.14-rc1.orig/arch/i386/kernel/smpboot.c	2005-09-20 20:38:22.000000000 -0700
+++ linux-2.6.14-rc1/arch/i386/kernel/smpboot.c	2005-09-28 12:54:08.000000000 -0700
@@ -898,7 +898,8 @@ static int __devinit do_boot_cpu(int api
 	 * This grunge runs the startup process for
 	 * the targeted processor.
 	 */
-	cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO);
+	if (!cpu_gdt_descr[cpu].address)
+		cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO);
 
 	atomic_set(&init_deasserted, 0);
 

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

* Re: [PATCH 3/3] Gdt hotplug
  2005-09-28 21:44 [PATCH 3/3] Gdt hotplug Zachary Amsden
@ 2005-09-28 22:15 ` Andi Kleen
  2005-09-28 22:20   ` Chris Wright
  2005-09-28 23:04   ` Zachary Amsden
  0 siblings, 2 replies; 4+ messages in thread
From: Andi Kleen @ 2005-09-28 22:15 UTC (permalink / raw)
  To: virtualization
  Cc: Zachary Amsden, Linus Torvalds, Jeffrey Sheldon, Ole Agesen,
	Shai Fultheim, Andrew Morton, Jack Lo, Ingo Molnar,
	Linux Kernel Mailing List, Chris Wright, Martin Bligh,
	Pratap Subrahmanyam, Christopher Li, H. Peter Anvin,
	Zwane Mwaikambo, Andi Kleen

On Wednesday 28 September 2005 23:44, Zachary Amsden wrote:
> As suggested by Andi Kleen, don't allocate a GDT page if there is already
> one present.  Needed for CPU hotplug.

Did I really suggest that? I think I suggested checking the return
value of gfp. Also get_zeroed_page() is slightly cleaner than GFP_ZERO.

-Andi

>
> Signed-off-by: Zachary Amsden <zach@vmware.com>
> Index: linux-2.6.14-rc1/arch/i386/kernel/smpboot.c
> ===================================================================
> --- linux-2.6.14-rc1.orig/arch/i386/kernel/smpboot.c	2005-09-20
> 20:38:22.000000000 -0700 +++
> linux-2.6.14-rc1/arch/i386/kernel/smpboot.c	2005-09-28 12:54:08.000000000
> -0700 @@ -898,7 +898,8 @@ static int __devinit do_boot_cpu(int api
>  	 * This grunge runs the startup process for
>  	 * the targeted processor.
>  	 */
> -	cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO);
> +	if (!cpu_gdt_descr[cpu].address)
> +		cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO);
>
>  	atomic_set(&init_deasserted, 0);

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

* Re: [PATCH 3/3] Gdt hotplug
  2005-09-28 22:15 ` Andi Kleen
@ 2005-09-28 22:20   ` Chris Wright
  2005-09-28 23:04   ` Zachary Amsden
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wright @ 2005-09-28 22:20 UTC (permalink / raw)
  To: Andi Kleen
  Cc: virtualization, Zachary Amsden, Linus Torvalds, Jeffrey Sheldon,
	Ole Agesen, Shai Fultheim, Andrew Morton, Jack Lo, Ingo Molnar,
	Linux Kernel Mailing List, Chris Wright, Martin Bligh,
	Pratap Subrahmanyam, Christopher Li, H. Peter Anvin,
	Zwane Mwaikambo, Andi Kleen

* Andi Kleen (ak@suse.de) wrote:
> On Wednesday 28 September 2005 23:44, Zachary Amsden wrote:
> > As suggested by Andi Kleen, don't allocate a GDT page if there is already
> > one present.  Needed for CPU hotplug.
> 
> Did I really suggest that? I think I suggested checking the return
> value of gfp. Also get_zeroed_page() is slightly cleaner than GFP_ZERO.

Yes, my recollection is you were talking about failed allocation.

thanks,
-chris

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

* Re: [PATCH 3/3] Gdt hotplug
  2005-09-28 22:15 ` Andi Kleen
  2005-09-28 22:20   ` Chris Wright
@ 2005-09-28 23:04   ` Zachary Amsden
  1 sibling, 0 replies; 4+ messages in thread
From: Zachary Amsden @ 2005-09-28 23:04 UTC (permalink / raw)
  To: Andi Kleen
  Cc: virtualization, Linus Torvalds, Jeffrey Sheldon, Ole Agesen,
	Shai Fultheim, Andrew Morton, Jack Lo, Ingo Molnar,
	Linux Kernel Mailing List, Chris Wright, Martin Bligh,
	Pratap Subrahmanyam, Christopher Li, H. Peter Anvin,
	Zwane Mwaikambo, Andi Kleen

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

Andi Kleen wrote:

>On Wednesday 28 September 2005 23:44, Zachary Amsden wrote:
>  
>
>>As suggested by Andi Kleen, don't allocate a GDT page if there is already
>>one present.  Needed for CPU hotplug.
>>    
>>
>
>Did I really suggest that? I think I suggested checking the return
>value of gfp. Also get_zeroed_page() is slightly cleaner than GFP_ZERO.
>  
>

Then I think this looks better all around.


[-- Attachment #2: gdt-hotplug --]
[-- Type: text/plain, Size: 1093 bytes --]

As suggested by Andi Kleen, don't allocate a GDT page if there is already one
present.  Needed for CPU hotplug.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.14-rc2/arch/i386/kernel/smpboot.c
===================================================================
--- linux-2.6.14-rc2.orig/arch/i386/kernel/smpboot.c	2005-09-28 15:49:26.000000000 -0700
+++ linux-2.6.14-rc2/arch/i386/kernel/smpboot.c	2005-09-28 16:00:55.000000000 -0700
@@ -874,6 +874,12 @@ static int __devinit do_boot_cpu(int api
 	unsigned long start_eip;
 	unsigned short nmi_high = 0, nmi_low = 0;
 
+	if (!cpu_gdt_descr[cpu].address &&
+	    !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) {
+		printk("Failed to allocate GDT for CPU %d\n", cpu);
+		return 1;
+	}
+
 	++cpucount;
 
 	/*
@@ -898,8 +904,6 @@ static int __devinit do_boot_cpu(int api
 	 * This grunge runs the startup process for
 	 * the targeted processor.
 	 */
-	cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO);
-
 	atomic_set(&init_deasserted, 0);
 
 	Dprintk("Setting warm reset code and vector.\n");

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

end of thread, other threads:[~2005-09-28 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-28 21:44 [PATCH 3/3] Gdt hotplug Zachary Amsden
2005-09-28 22:15 ` Andi Kleen
2005-09-28 22:20   ` Chris Wright
2005-09-28 23:04   ` Zachary Amsden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox