From: Max Krasnyansky <maxk@qualcomm.com>
To: mingo@elte.hu
Cc: pj@sgi.com, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org,
menage@google.com, rostedt@goodmis.org,
Max Krasnyansky <maxk@qualcomm.com>
Subject: [PATCH] sched: CPU hotplug events must not destroy scheduler domains created by the cpusets
Date: Mon, 2 Jun 2008 14:08:22 -0700 [thread overview]
Message-ID: <1212440902-31215-2-git-send-email-maxk@qualcomm.com> (raw)
This is an updated/split up version of the patch I sent earlier.
Currently sched domains created by the cpusets are completely destroyed
during CPU hotplug event handling. For each CPU hotplug event scheduler
attaches all CPUs to the NULL domain and then puts them all into a single
domain thereby destroying domains created by the cpusets.
The solution is simple, when cpusets are enabled scheduler should not
create the default domain and instead let cpusets rebuild the domains based
on the current settings. Which is exactly what the patch does.
This is just a bug fix and should go into 2.6.26 and .25-stable.
Signed-off-by: Max Krasnyansky <maxk@qualcomm.com>
---
kernel/cpuset.c | 6 ++++++
kernel/sched.c | 8 ++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index a1b61f4..29c6304 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1789,6 +1789,12 @@ static void common_cpu_mem_hotplug_unplug(void)
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
scan_for_empty_cpusets(&top_cpuset);
+ /*
+ * Scheduler destroys domains on hotplug events.
+ * Rebuild them based on the current settings.
+ */
+ rebuild_sched_domains();
+
cgroup_unlock();
}
diff --git a/kernel/sched.c b/kernel/sched.c
index 465f3c8..da7c6c2 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7091,8 +7091,16 @@ static int update_sched_domains(struct notifier_block *nfb,
return NOTIFY_DONE;
}
+#ifndef CONFIG_CPUSETS
+ /*
+ * Create default domain partitioning if cpusets are disabled.
+ * Otherwise we let cpusets rebuild the domains based on the
+ * current setup.
+ */
+
/* The hotplug lock is already held by cpu_up/cpu_down */
arch_init_sched_domains(&cpu_online_map);
+#endif
return NOTIFY_OK;
}
--
1.5.4.5
next reply other threads:[~2008-06-02 21:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 21:08 Max Krasnyansky [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-05-29 18:17 [PATCH] sched: CPU hotplug events must not destroy scheduler domains created by the cpusets Max Krasnyansky
2008-06-02 15:19 ` Paul Jackson
2008-06-02 17:55 ` Max Krasnyansky
2008-06-02 19:01 ` Max Krasnyansky
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=1212440902-31215-2-git-send-email-maxk@qualcomm.com \
--to=maxk@qualcomm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--cc=pj@sgi.com \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox