* [ANNOUNCE] HotPlug CPU patch against 2.4.5
@ 2001-06-16 13:29 Rusty Russell
2001-06-16 13:59 ` Christoph Hellwig
2001-06-26 17:07 ` Greg KH
0 siblings, 2 replies; 6+ messages in thread
From: Rusty Russell @ 2001-06-16 13:29 UTC (permalink / raw)
To: linux-kernel; +Cc: Heiko Carstens, suganuma, Anton Blanchard, Jason McMullan
Hi all,
http://sourceforge.net/projects/lhcs/
Version 0.3 (untested) of the HotPlug CPU Patch is out, with
ia64 and x86 support. Bringing CPUs down and up is as simple as:
# Down...
echo 0 > /proc/sys/cpu/1
# Up...
echo 1 > /proc/sys/cpu/1
Apologies for the slow release, and *huge* kudos to the people
who did the real work for this release:
Kimio Suganuma (ia64)
Jason McMullan (x86)
Thanks!
Rusty.
--
Premature optmztion is rt of all evl. --DK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ANNOUNCE] HotPlug CPU patch against 2.4.5
2001-06-16 13:29 [ANNOUNCE] HotPlug CPU patch against 2.4.5 Rusty Russell
@ 2001-06-16 13:59 ` Christoph Hellwig
2001-06-17 5:32 ` Rusty Russell
2001-06-26 17:07 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2001-06-16 13:59 UTC (permalink / raw)
To: Rusty Russell, linux-kernel
Cc: linux-kernel, Heiko Carstens, suganuma, Anton Blanchard, Jason McMullan
In article <m15BG8K-001UIwC@mozart> you wrote:
> Hi all,
>
> http://sourceforge.net/projects/lhcs/
>
> Version 0.3 (untested) of the HotPlug CPU Patch is out, with
> ia64 and x86 support. Bringing CPUs down and up is as simple as:
>
> # Down...
> echo 0 > /proc/sys/cpu/1
> # Up...
> echo 1 > /proc/sys/cpu/1
Wouldn't /proc/sys/cpu/<num>/enable be better? This way other per-cpu
sysctls could be added more easily...
</nitpick>
Christoph
--
Of course it doesn't work. We've performed a software upgrade.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ANNOUNCE] HotPlug CPU patch against 2.4.5
2001-06-16 13:59 ` Christoph Hellwig
@ 2001-06-17 5:32 ` Rusty Russell
2001-06-17 5:40 ` Alexander Viro
0 siblings, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2001-06-17 5:32 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel
In message <200106161359.f5GDxQ214335@ns.caldera.de> you write:
> In article <m15BG8K-001UIwC@mozart> you wrote:
> > # Up...
> > echo 1 > /proc/sys/cpu/1
>
> Wouldn't /proc/sys/cpu/<num>/enable be better? This way other per-cpu
> sysctls could be added more easily...
Yep. But rewrite the sysctl crap first to make dynamically adding and
deleting entries sane.
Cheers,
Rusty.
--
Premature optmztion is rt of all evl. --DK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ANNOUNCE] HotPlug CPU patch against 2.4.5
2001-06-17 5:32 ` Rusty Russell
@ 2001-06-17 5:40 ` Alexander Viro
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Viro @ 2001-06-17 5:40 UTC (permalink / raw)
To: Rusty Russell; +Cc: Christoph Hellwig, linux-kernel
On Sun, 17 Jun 2001, Rusty Russell wrote:
> In message <200106161359.f5GDxQ214335@ns.caldera.de> you write:
> > In article <m15BG8K-001UIwC@mozart> you wrote:
> > > # Up...
> > > echo 1 > /proc/sys/cpu/1
> >
> > Wouldn't /proc/sys/cpu/<num>/enable be better? This way other per-cpu
> > sysctls could be added more easily...
>
> Yep. But rewrite the sysctl crap first to make dynamically adding and
> deleting entries sane.
I had, actually. 2.5 stuff, but as soon as fs/super.c merge gets into the
sane area I'll see what can be safely merged into 2.4. Sorry - it touches
quite a few places and running two splitups in parallel... <shudder> As
soon as this fscking roll of barbwire^W^W^Wset of locking changes gets
untangled...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ANNOUNCE] HotPlug CPU patch against 2.4.5
2001-06-16 13:29 [ANNOUNCE] HotPlug CPU patch against 2.4.5 Rusty Russell
2001-06-16 13:59 ` Christoph Hellwig
@ 2001-06-26 17:07 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2001-06-26 17:07 UTC (permalink / raw)
To: Rusty Russell
Cc: linux-kernel, Heiko Carstens, suganuma, Anton Blanchard, Jason McMullan
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
On Sat, Jun 16, 2001 at 11:29:00PM +1000, Rusty Russell wrote:
> Hi all,
>
> http://sourceforge.net/projects/lhcs/
>
> Version 0.3 (untested) of the HotPlug CPU Patch is out, with
> ia64 and x86 support.
Here's a patch to the patch that adds /sbin/hotplug support (sorry, I
couldn't resist...)
It also fixes a '}' problem in fs/proc/proc_misc.c
thanks,
greg k-h
[-- Attachment #2: cpu-hotplug-2.4.5.patch --]
[-- Type: text/plain, Size: 2204 bytes --]
diff -Naur -X /home/greg/linux/dontdiff linux-2.4.5-hotplug/fs/proc/proc_misc.c linux-2.4.5-hotplug-greg/fs/proc/proc_misc.c
--- linux-2.4.5-hotplug/fs/proc/proc_misc.c Tue Jun 26 09:23:00 2001
+++ linux-2.4.5-hotplug-greg/fs/proc/proc_misc.c Tue Jun 26 09:43:57 2001
@@ -295,6 +295,7 @@
jif - ( kstat.per_cpu_user[i] \
+ kstat.per_cpu_nice[i] \
+ kstat.per_cpu_system[i]));
+ }
len += sprintf(page + len,
"page %u %u\n"
"swap %u %u\n"
diff -Naur -X /home/greg/linux/dontdiff linux-2.4.5-hotplug/kernel/cpu.c linux-2.4.5-hotplug-greg/kernel/cpu.c
--- linux-2.4.5-hotplug/kernel/cpu.c Tue Jun 26 09:23:00 2001
+++ linux-2.4.5-hotplug-greg/kernel/cpu.c Tue Jun 26 10:00:45 2001
@@ -8,6 +8,7 @@
#include <linux/notifier.h>
#include <linux/sched.h>
#include <linux/sched.h>
+#include <linux/kmod.h> /* for hotplug_path */
#include <asm/semaphore.h>
#include <asm/uaccess.h>
@@ -17,6 +18,38 @@
static struct notifier_block *cpu_chain = NULL;
+#ifdef CONFIG_HOTPLUG
+/* Notify userspace when a cpu event occurs,
+ * by running '/sbin/hotplug cpu' with certain
+ * environment variables set.
+ */
+static int cpu_run_sbin_hotplug(unsigned int cpu, char *action)
+{
+ char *argv[3], *envp[5], cpu_str[12], action_str[32];
+ int i;
+
+ sprintf(cpu_str, "CPU=%d", cpu);
+ sprintf(action_str, "ACTION=%s", action);
+
+ i = 0;
+ argv[i++] = hotplug_path;
+ argv[i++] = "cpu";
+ argv[i] = 0;
+
+ i = 0;
+ /* minimal command environment */
+ envp [i++] = "HOME=/";
+ envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+ envp [i++] = cpu_str;
+ envp [i++] = action_str;
+ envp [i] = 0;
+
+ return call_usermodehelper(argv [0], argv, envp);
+}
+#else
+#define cpu_run_sbin_hotplug(cpu, action) ({ 0; })
+#endif
+
/* Should really be in a header somewhere. */
asmlinkage long sys_sched_get_priority_max(int policy);
@@ -120,6 +153,8 @@
/* Die, CPU, die! */
__cpu_die(cpu);
+ cpu_run_sbin_hotplug(cpu, "remove");
+
out:
up(&cpucontrol);
return ret;
@@ -145,6 +180,8 @@
/* Friendly to make sure everyone knows it's up before we
return */
__synchronize_kernel();
+
+ cpu_run_sbin_hotplug(cpu, "add");
out:
up(&cpucontrol);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ANNOUNCE] HotPlug CPU patch against 2.4.5
@ 2001-07-03 8:30 Rusty Russell
0 siblings, 0 replies; 6+ messages in thread
From: Rusty Russell @ 2001-07-03 8:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg KH
Hi all,
http://sourceforge.net/projects/lhcs/
Version 0.5 (should actually compile) of the HotPlug CPU Patch
is out. This adds /sbin/hotplug support (thanks Greg), which is
almost useful.
Of course, /sbin/hotplug falls far short of allowing you to
stop CPUs from going down or coming up, or do something *before* CPUs
go down or up, and it uses env vars to pass what it's doing, but we've
had worse infrastructure in the kernel *cough*sysctl*cough*. </rant>
Cheers!
Rusty.
--
Premature optmztion is rt of all evl. --DK
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-07-03 10:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-16 13:29 [ANNOUNCE] HotPlug CPU patch against 2.4.5 Rusty Russell
2001-06-16 13:59 ` Christoph Hellwig
2001-06-17 5:32 ` Rusty Russell
2001-06-17 5:40 ` Alexander Viro
2001-06-26 17:07 ` Greg KH
2001-07-03 8:30 Rusty Russell
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).