public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* HOTPLUG CPU Support for SMT
@ 2005-05-30 15:25 jayush luniya
  2005-05-30 16:51 ` Zwane Mwaikambo
  2005-05-30 21:30 ` Rutger Nijlunsing
  0 siblings, 2 replies; 5+ messages in thread
From: jayush luniya @ 2005-05-30 15:25 UTC (permalink / raw)
  To: linux-kernel

Hi,

I have been looking at the CONFIG_HOTPLUG_CPU option
in the Linux Kernel. The option works for IA64, PPP64,
S390 architectures. I am doing my research on SMT
architecture and want to write a kernel module that
can dynamically enable/disable SMT, so that I can
switch between uniprocessor mode and SMT mode. So is
it possible to use the CONFIG_HOTPLUG_CPU option to
dynamically enable/disable a logical processor by
performing a logical removal of the CPU since the
hardware does not support CPU hotplugging? Also I
would like to know how efficient such an
implementation would be? 

I would really appreciate if anyone could provide me
suggestions and any specific patches related to this
work.

Regards,
Jayush.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

* Re: HOTPLUG CPU Support for SMT
  2005-05-30 15:25 HOTPLUG CPU Support for SMT jayush luniya
@ 2005-05-30 16:51 ` Zwane Mwaikambo
  2005-05-31  5:17   ` Srivatsa Vaddagiri
  2005-05-30 21:30 ` Rutger Nijlunsing
  1 sibling, 1 reply; 5+ messages in thread
From: Zwane Mwaikambo @ 2005-05-30 16:51 UTC (permalink / raw)
  To: jayush luniya; +Cc: linux-kernel

On Mon, 30 May 2005, jayush luniya wrote:

> I have been looking at the CONFIG_HOTPLUG_CPU option
> in the Linux Kernel. The option works for IA64, PPP64,
> S390 architectures. I am doing my research on SMT
> architecture and want to write a kernel module that
> can dynamically enable/disable SMT, so that I can
> switch between uniprocessor mode and SMT mode. So is
> it possible to use the CONFIG_HOTPLUG_CPU option to
> dynamically enable/disable a logical processor by
> performing a logical removal of the CPU since the
> hardware does not support CPU hotplugging? Also I
> would like to know how efficient such an
> implementation would be? 
> 
> I would really appreciate if anyone could provide me
> suggestions and any specific patches related to this
> work.

Yes, older 2.6-mm kernel (2.6.10-mm) trees have the "toy" i386 hotplug 
cpu implementation which does what you want.

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

* Re: HOTPLUG CPU Support for SMT
  2005-05-30 15:25 HOTPLUG CPU Support for SMT jayush luniya
  2005-05-30 16:51 ` Zwane Mwaikambo
@ 2005-05-30 21:30 ` Rutger Nijlunsing
  1 sibling, 0 replies; 5+ messages in thread
From: Rutger Nijlunsing @ 2005-05-30 21:30 UTC (permalink / raw)
  To: jayush luniya; +Cc: linux-kernel

On Mon, May 30, 2005 at 08:25:34AM -0700, jayush luniya wrote:
> Hi,
> 
> I have been looking at the CONFIG_HOTPLUG_CPU option
> in the Linux Kernel. The option works for IA64, PPP64,
> S390 architectures. I am doing my research on SMT
> architecture and want to write a kernel module that
> can dynamically enable/disable SMT, so that I can
> switch between uniprocessor mode and SMT mode. So is
> it possible to use the CONFIG_HOTPLUG_CPU option to
> dynamically enable/disable a logical processor by
> performing a logical removal of the CPU since the
> hardware does not support CPU hotplugging? Also I
> would like to know how efficient such an
> implementation would be? 
> 
> I would really appreciate if anyone could provide me
> suggestions and any specific patches related to this
> work.

An easy way would be to use sched_setaffinity() and bind all processes
to one processor.

-- 
Rutger Nijlunsing

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

* Re: HOTPLUG CPU Support for SMT
  2005-05-30 16:51 ` Zwane Mwaikambo
@ 2005-05-31  5:17   ` Srivatsa Vaddagiri
  2005-05-31 14:34     ` Zwane Mwaikambo
  0 siblings, 1 reply; 5+ messages in thread
From: Srivatsa Vaddagiri @ 2005-05-31  5:17 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: jayush luniya, linux-kernel

On Mon, May 30, 2005 at 04:50:27PM +0000, Zwane Mwaikambo wrote:
> Yes, older 2.6-mm kernel (2.6.10-mm) trees have the "toy" i386 hotplug 
> cpu implementation which does what you want.

AFAIK in the i386 "toy" implementation, when a CPU is offlined, it stops
taking interrupts and stops running tasks, but it _still_ executes a while
loop in the context of its idle task (with IRQs disabled). The loop
is exited when we have to bring online the CPU again. What this means is 
I don't think by offlining the CPU, we are removing any activity associated
with the corresponding h/w thread. 

Maybe the toy implementation could be modified to take care of it? Something
like lowering the priority of the h/w thread so that it consumes minimal 
CPU resources to execute its while loop.

-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017

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

* Re: HOTPLUG CPU Support for SMT
  2005-05-31  5:17   ` Srivatsa Vaddagiri
@ 2005-05-31 14:34     ` Zwane Mwaikambo
  0 siblings, 0 replies; 5+ messages in thread
From: Zwane Mwaikambo @ 2005-05-31 14:34 UTC (permalink / raw)
  To: Srivatsa Vaddagiri; +Cc: jayush luniya, linux-kernel

On Tue, 31 May 2005, Srivatsa Vaddagiri wrote:

> On Mon, May 30, 2005 at 04:50:27PM +0000, Zwane Mwaikambo wrote:
> > Yes, older 2.6-mm kernel (2.6.10-mm) trees have the "toy" i386 hotplug 
> > cpu implementation which does what you want.
> 
> AFAIK in the i386 "toy" implementation, when a CPU is offlined, it stops
> taking interrupts and stops running tasks, but it _still_ executes a while
> loop in the context of its idle task (with IRQs disabled). The loop
> is exited when we have to bring online the CPU again. What this means is 
> I don't think by offlining the CPU, we are removing any activity associated
> with the corresponding h/w thread. 
> 
> Maybe the toy implementation could be modified to take care of it? Something
> like lowering the priority of the h/w thread so that it consumes minimal 
> CPU resources to execute its while loop.

A cpu_relax() there would help greatly and essentially "drops" the 
priority of the processor executing it (since 'pause' is a hint that that 
logical processor would like to yield execution resources), although there 
would still be traffic due to accessing get_cpu_var, which should be minimal as 
it'll be at most 1 non shared cacheline so you could account for it in the 
statement of errors. I used to have a personal implementation for one of 
the systems i use which does a hlt in that loop and i wake up the 
procsesor via IPI. So perhaps some kernel hacking might be required 
(albeit minimal) ;)

	Zwane


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

end of thread, other threads:[~2005-05-31 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-30 15:25 HOTPLUG CPU Support for SMT jayush luniya
2005-05-30 16:51 ` Zwane Mwaikambo
2005-05-31  5:17   ` Srivatsa Vaddagiri
2005-05-31 14:34     ` Zwane Mwaikambo
2005-05-30 21:30 ` Rutger Nijlunsing

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