* [PATCH] Hot swap CPU support for 2.4.1
@ 2001-02-05 4:00 Rusty Russell
2001-02-05 5:50 ` Lars Marowsky-Bree
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Rusty Russell @ 2001-02-05 4:00 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 982 bytes --]
Hi all,
I did the infrastructure, Anton did the bugfinding and PPC support,
aka. the hard stuff. Other architectures need to implement
__cpu_disable, __cpu_die and __cpu_up for them to work. Volunteers
appreciated.
This patch allows you to down & up CPUs as follows:
# echo 0 > /proc/sys/cpu/0/online
# echo 1 > /proc/sys/cpu/0/online
The relatively trivial patch works as follows:
1) Implements synchronize_kernel() (thanks Andi Kleen for forwarding
Paul McKenney's quiescent-state ideas) which waits for a schedule
on all CPUs.
2) All CPU numbers are now physical: removes cpu_number_map,
cpu_logical_map and smp_num_cpus.
3) Adds cpu_online(cpu) and cpu_num_online() macros.
4) Adds cpu_down() and cpu_up() calls, which call arch-specific
__cpu_disable(cpu), __cpu_die(cpu) and __cpu_up(cpu).
5) Fixes schedule() to check allowed_cpus even if rescheduling same
task.
Since it's 60k long, mime attached bzip2.
Go hack!
Rusty Russell & Anton Blanchard
--
[-- Attachment #2: hotswap CPU patch --]
[-- Type: application/octet-stream, Size: 13894 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Hot swap CPU support for 2.4.1
2001-02-05 4:00 [PATCH] Hot swap CPU support for 2.4.1 Rusty Russell
@ 2001-02-05 5:50 ` Lars Marowsky-Bree
2001-02-05 6:06 ` Anton Blanchard
2001-02-05 21:19 ` [PATCH] Hot swap CPU support for 2.4.1@ lists
2001-02-10 23:29 ` [PATCH] Hot swap CPU support for 2.4.1 Pavel Machek
2 siblings, 1 reply; 7+ messages in thread
From: Lars Marowsky-Bree @ 2001-02-05 5:50 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
On 2001-02-05T15:00:40,
Rusty Russell <rusty@linuxcare.com.au> said:
> I did the infrastructure, Anton did the bugfinding and PPC support,
> aka. the hard stuff. Other architectures need to implement
> __cpu_disable, __cpu_die and __cpu_up for them to work. Volunteers
> appreciated.
Rusty, what would be needed to "hot-add" CPUs ?
Sincerely,
Lars Marowsky-Brée <lars.marowsky-bree@sap.com>
SuSE Linux AG at the SAP LinuxLab - lmb@suse.de
--
Perfection is our goal, excellence will be tolerated. -- J. Yahl
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Hot swap CPU support for 2.4.1
2001-02-05 5:50 ` Lars Marowsky-Bree
@ 2001-02-05 6:06 ` Anton Blanchard
0 siblings, 0 replies; 7+ messages in thread
From: Anton Blanchard @ 2001-02-05 6:06 UTC (permalink / raw)
To: Lars Marowsky-Bree; +Cc: Rusty Russell, linux-kernel
> Rusty, what would be needed to "hot-add" CPUs ?
The PPC version at the moment simply locks a cpu in the idle loop
with __cli(); while(1); for cpu down and jumps out of it for cpu up.
Good for testing but not very useful. After talking to paulus we
will use the RTAS cpu stop and cpu start.
In order to bring a new cpu up you will need to duplicate a lot of
the stuff in smp_boot_cpus or else just set up all NR_CPUS of these
structures (eg NR_CPUS idle threads etc) at boot time.
Anton
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Hot swap CPU support for 2.4.1@
2001-02-05 4:00 [PATCH] Hot swap CPU support for 2.4.1 Rusty Russell
2001-02-05 5:50 ` Lars Marowsky-Bree
@ 2001-02-05 21:19 ` lists
2001-02-06 14:17 ` Anton Blanchard
2001-02-10 23:29 ` [PATCH] Hot swap CPU support for 2.4.1 Pavel Machek
2 siblings, 1 reply; 7+ messages in thread
From: lists @ 2001-02-05 21:19 UTC (permalink / raw)
To: Rusty Russell, linux-kernel
Would any special hardware besides a multi-cpu system be necessarey to
test this out?
Matthew Fredrickson
On Mon, Feb 05, 2001 at 03:00:40PM +1100, Rusty Russell wrote:
> Hi all,
>
> I did the infrastructure, Anton did the bugfinding and PPC support,
> aka. the hard stuff. Other architectures need to implement
> __cpu_disable, __cpu_die and __cpu_up for them to work. Volunteers
> appreciated.
>
> This patch allows you to down & up CPUs as follows:
> # echo 0 > /proc/sys/cpu/0/online
> # echo 1 > /proc/sys/cpu/0/online
>
> The relatively trivial patch works as follows:
>
> 1) Implements synchronize_kernel() (thanks Andi Kleen for forwarding
> Paul McKenney's quiescent-state ideas) which waits for a schedule
> on all CPUs.
> 2) All CPU numbers are now physical: removes cpu_number_map,
> cpu_logical_map and smp_num_cpus.
> 3) Adds cpu_online(cpu) and cpu_num_online() macros.
> 4) Adds cpu_down() and cpu_up() calls, which call arch-specific
> __cpu_disable(cpu), __cpu_die(cpu) and __cpu_up(cpu).
> 5) Fixes schedule() to check allowed_cpus even if rescheduling same
> task.
>
> Since it's 60k long, mime attached bzip2.
>
> Go hack!
> Rusty Russell & Anton Blanchard
> --
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Hot swap CPU support for 2.4.1@
2001-02-05 21:19 ` [PATCH] Hot swap CPU support for 2.4.1@ lists
@ 2001-02-06 14:17 ` Anton Blanchard
0 siblings, 0 replies; 7+ messages in thread
From: Anton Blanchard @ 2001-02-06 14:17 UTC (permalink / raw)
To: lists; +Cc: linux-kernel
> Would any special hardware besides a multi-cpu system be necessarey to
> test this out?
You should be able to run it on any SMP machine assuming you write the
arch specific code (PPC could be used as an example). Of course it isn't
very interesting if the hardware doesn't support hot swap :)
As soon as I get the SMP ultra booting again (I arrived one morning to
hear the disk was making loud grinding noises) I'll code up sparc (ie E10K)
support. It sounds like S390 support will be trivial, I'd love to get my
hands on one of those :)
Anton
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Hot swap CPU support for 2.4.1
2001-02-05 4:00 [PATCH] Hot swap CPU support for 2.4.1 Rusty Russell
2001-02-05 5:50 ` Lars Marowsky-Bree
2001-02-05 21:19 ` [PATCH] Hot swap CPU support for 2.4.1@ lists
@ 2001-02-10 23:29 ` Pavel Machek
2001-02-11 23:05 ` Rusty Russell
2 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2001-02-10 23:29 UTC (permalink / raw)
To: Rusty Russell; +Cc: kernel list
Hi!
> I did the infrastructure, Anton did the bugfinding and PPC support,
> aka. the hard stuff. Other architectures need to implement
> __cpu_disable, __cpu_die and __cpu_up for them to work. Volunteers
> appreciated.
>
> This patch allows you to down & up CPUs as follows:
> # echo 0 > /proc/sys/cpu/0/online
> # echo 1 > /proc/sys/cpu/0/online
>
> The relatively trivial patch works as follows:
>
> 1) Implements synchronize_kernel() (thanks Andi Kleen for forwarding
> Paul McKenney's quiescent-state ideas) which waits for a schedule
> on all CPUs.
> 2) All CPU numbers are now physical: removes cpu_number_map,
> cpu_logical_map and smp_num_cpus.
> 3) Adds cpu_online(cpu) and cpu_num_online() macros.
> 4) Adds cpu_down() and cpu_up() calls, which call arch-specific
> __cpu_disable(cpu), __cpu_die(cpu) and __cpu_up(cpu).
> 5) Fixes schedule() to check allowed_cpus even if rescheduling same
> task.
This is not quite right:
@@ -1643,7 +1643,7 @@
printk(KERN_NOTICE "apm: disabled on user
request.\n");
return -ENODEV;
}
- if ((smp_num_cpus > 1) && !power_off) {
+ if ((num_online_cpus() > 1) && !power_off) {
printk(KERN_NOTICE "apm: disabled - APM is not SMP
safe.\n");
return -ENODEV;
}
@@ -1697,7 +1697,7 @@
kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES |
CLONE_SIGHAND | SIGCHLD);
- if (smp_num_cpus > 1) {
+ if (num_online_cpus() > 1) {
printk(KERN_NOTICE
"apm: disabled - APM is not SMP safe (power off
active).\n");
return 0;
I do not think it is safe to call APM when there is just CPU #5
running. smp_num_cpus in this context means "if we ever had more than
boot cpu".
Pavel
--
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Hot swap CPU support for 2.4.1
2001-02-10 23:29 ` [PATCH] Hot swap CPU support for 2.4.1 Pavel Machek
@ 2001-02-11 23:05 ` Rusty Russell
0 siblings, 0 replies; 7+ messages in thread
From: Rusty Russell @ 2001-02-11 23:05 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
In message <20010211002955.I7877@bug.ucw.cz> you write:
> This is not quite right:
>
> @@ -1643,7 +1643,7 @@
> printk(KERN_NOTICE "apm: disabled on user
> request.\n");
> return -ENODEV;
> }
> - if ((smp_num_cpus > 1) && !power_off) {
> + if ((num_online_cpus() > 1) && !power_off) {
> printk(KERN_NOTICE "apm: disabled - APM is not SMP
>
> I do not think it is safe to call APM when there is just CPU #5
> running. smp_num_cpus in this context means "if we ever had more than
> boot cpu".
Um, it's not safe to call APM in SMP full stop: we try anyway.
However, this code changes nothing since it's only run at boot.
Cheers,
Rusty.
--
Premature optmztion is rt of all evl. --DK
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-02-11 23:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-05 4:00 [PATCH] Hot swap CPU support for 2.4.1 Rusty Russell
2001-02-05 5:50 ` Lars Marowsky-Bree
2001-02-05 6:06 ` Anton Blanchard
2001-02-05 21:19 ` [PATCH] Hot swap CPU support for 2.4.1@ lists
2001-02-06 14:17 ` Anton Blanchard
2001-02-10 23:29 ` [PATCH] Hot swap CPU support for 2.4.1 Pavel Machek
2001-02-11 23:05 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox