From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Nathan Lynch <nathanl@austin.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] cpu: add a CPU_DOWN_PREPARE notifier
Date: Wed, 08 Sep 2004 22:52:00 +1000 [thread overview]
Message-ID: <413F0070.2020104@yahoo.com.au> (raw)
In-Reply-To: <413EFFFB.5050902@yahoo.com.au>
[-- Attachment #1: Type: text/plain, Size: 27 bytes --]
2/3
Rusty, can I do this?
[-- Attachment #2: hotplug-cpu_down_prepare-notifier.patch --]
[-- Type: text/x-patch, Size: 2162 bytes --]
Add a CPU_DOWN_PREPARE hotplug CPU notifier. This is needed so we can
dettach all sched-domains before a CPU goes down, thus we can build
domains from online cpumasks, and not have to check for the possibility
of a CPU coming up or going down.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
---
linux-2.6-npiggin/include/linux/notifier.h | 9 +++++----
linux-2.6-npiggin/kernel/cpu.c | 9 +++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff -puN kernel/cpu.c~hotplug-cpu_down_prepare-notifier kernel/cpu.c
--- linux-2.6/kernel/cpu.c~hotplug-cpu_down_prepare-notifier 2004-09-08 22:39:28.000000000 +1000
+++ linux-2.6-npiggin/kernel/cpu.c 2004-09-08 22:39:28.000000000 +1000
@@ -119,6 +119,15 @@ int cpu_down(unsigned int cpu)
goto out;
}
+ err = notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
+ (void *)(long)cpu);
+ if (err == NOTIFY_BAD) {
+ printk("%s: attempt to take down CPU %u failed\n",
+ __FUNCTION__, cpu);
+ err = -EINVAL;
+ goto out;
+ }
+
/* Ensure that we are not runnable on dying cpu */
old_allowed = current->cpus_allowed;
tmp = CPU_MASK_ALL;
diff -puN include/linux/notifier.h~hotplug-cpu_down_prepare-notifier include/linux/notifier.h
--- linux-2.6/include/linux/notifier.h~hotplug-cpu_down_prepare-notifier 2004-09-08 22:39:28.000000000 +1000
+++ linux-2.6-npiggin/include/linux/notifier.h 2004-09-08 22:39:28.000000000 +1000
@@ -60,10 +60,11 @@ extern int notifier_call_chain(struct no
#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */
-#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
-#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
-#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
-#define CPU_DEAD 0x0006 /* CPU (unsigned)v dead */
+#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
+#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
+#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
+#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
+#define CPU_DEAD 0x0006 /* CPU (unsigned)v dead */
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */
_
next prev parent reply other threads:[~2004-09-08 14:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-08 12:50 [PATCH 1/3] sched: trivial changes Nick Piggin
2004-09-08 12:52 ` Nick Piggin [this message]
2004-09-08 12:57 ` [PATCH 3/3] sched: cpu hotplug notifier for updating sched domains Nick Piggin
2004-09-08 15:43 ` Nathan Lynch
2004-09-08 15:55 ` [PATCH] fix schedstats null deref in sched_exec Nathan Lynch
2004-09-08 23:45 ` Nick Piggin
2004-09-09 10:23 ` [PATCH 2/3] cpu: add a CPU_DOWN_PREPARE notifier Rusty Russell
2004-09-09 10:24 ` Nick Piggin
2004-09-09 11:00 ` Nick Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=413F0070.2020104@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=nathanl@austin.ibm.com \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.