From: Con Kolivas <kernel@kolivas.org>
To: linux <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
Peter Williams <pwil3058@bigpond.net.au>,
William Lee Irwin III <wli@holomorphy.com>,
Alexander Nyberg <alexn@dsv.su.se>,
Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [PATCH][plugsched 24/28] Make public parts of sched_domains
Date: Sun, 31 Oct 2004 00:41:07 +1000 [thread overview]
Message-ID: <4183A803.6030406@kolivas.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 36 bytes --]
Make public parts of sched_domains
[-- Attachment #1.2: publicise_domains.diff --]
[-- Type: text/x-patch, Size: 4892 bytes --]
Put common scheduler domains code into scheduler.c
Signed-off-by: Con Kolivas <kernel@kolivas.org>
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/sched.h
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/include/linux/sched.h 2004-10-30 00:19:32.642969636 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/include/linux/sched.h 2004-10-30 00:20:11.034827926 +1000
@@ -456,13 +456,11 @@ struct sched_domain {
#endif
};
-extern void cpu_attach_domain(struct sched_domain *sd, int cpu);
-#ifdef ARCH_HAS_SCHED_DOMAIN
/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
-extern cpumask_t cpu_isolated_map;
+extern void cpu_attach_domain(struct sched_domain *sd, int cpu);
extern void init_sched_build_groups(struct sched_group groups[],
cpumask_t span, int (*group_fn)(int cpu));
-#endif /* ARCH_HAS_SCHED_DOMAIN */
+extern cpumask_t cpu_isolated_map;
#endif /* CONFIG_SMP */
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/sched.c 2004-10-30 00:19:32.640969956 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c 2004-10-30 00:20:11.036827607 +1000
@@ -3561,9 +3561,6 @@ static void __devinit ingo_cpu_attach_do
}
}
-/* cpus with isolated domains */
-cpumask_t __devinitdata cpu_isolated_map = CPU_MASK_NONE;
-
/* Setup the mask of cpus configured for isolated domains */
static int __init isolated_cpu_setup(char *str)
{
@@ -3578,52 +3575,6 @@ static int __init isolated_cpu_setup(cha
__setup ("isolcpus=", isolated_cpu_setup);
-/*
- * init_sched_build_groups takes an array of groups, the cpumask we wish
- * to span, and a pointer to a function which identifies what group a CPU
- * belongs to. The return value of group_fn must be a valid index into the
- * groups[] array, and must be >= 0 and < NR_CPUS (due to the fact that we
- * keep track of groups covered with a cpumask_t).
- *
- * init_sched_build_groups will build a circular linked list of the groups
- * covered by the given span, and will set each group's ->cpumask correctly,
- * and ->cpu_power to 0.
- */
-void __devinit init_sched_build_groups(struct sched_group groups[],
- cpumask_t span, int (*group_fn)(int cpu))
-{
- struct sched_group *first = NULL, *last = NULL;
- cpumask_t covered = CPU_MASK_NONE;
- int i;
-
- for_each_cpu_mask(i, span) {
- int group = group_fn(i);
- struct sched_group *sg = &groups[group];
- int j;
-
- if (cpu_isset(i, covered))
- continue;
-
- sg->cpumask = CPU_MASK_NONE;
- sg->cpu_power = 0;
-
- for_each_cpu_mask(j, span) {
- if (group_fn(j) != group)
- continue;
-
- cpu_set(j, covered);
- cpu_set(j, sg->cpumask);
- }
- if (!first)
- first = sg;
- if (last)
- last->next = sg;
- last = sg;
- }
- last->next = first;
-}
-
-
#ifdef ARCH_HAS_SCHED_DOMAIN
extern void __devinit arch_init_sched_domains(void);
extern void __devinit arch_destroy_sched_domains(void);
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/scheduler.c 2004-10-30 00:20:06.213599204 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c 2004-10-30 00:20:11.037827447 +1000
@@ -878,6 +878,56 @@ void fastcall complete_all(struct comple
}
EXPORT_SYMBOL(complete_all);
+#ifdef CONFIG_SMP
+/* cpus with isolated domains */
+cpumask_t __devinitdata cpu_isolated_map = CPU_MASK_NONE;
+
+/*
+ * init_sched_build_groups takes an array of groups, the cpumask we wish
+ * to span, and a pointer to a function which identifies what group a CPU
+ * belongs to. The return value of group_fn must be a valid index into the
+ * groups[] array, and must be >= 0 and < NR_CPUS (due to the fact that we
+ * keep track of groups covered with a cpumask_t).
+ *
+ * init_sched_build_groups will build a circular linked list of the groups
+ * covered by the given span, and will set each group's ->cpumask correctly,
+ * and ->cpu_power to 0.
+ */
+void __devinit init_sched_build_groups(struct sched_group groups[],
+ cpumask_t span, int (*group_fn)(int cpu))
+{
+ struct sched_group *first = NULL, *last = NULL;
+ cpumask_t covered = CPU_MASK_NONE;
+ int i;
+
+ for_each_cpu_mask(i, span) {
+ int group = group_fn(i);
+ struct sched_group *sg = &groups[group];
+ int j;
+
+ if (cpu_isset(i, covered))
+ continue;
+
+ sg->cpumask = CPU_MASK_NONE;
+ sg->cpu_power = 0;
+
+ for_each_cpu_mask(j, span) {
+ if (group_fn(j) != group)
+ continue;
+
+ cpu_set(j, covered);
+ cpu_set(j, sg->cpumask);
+ }
+ if (!first)
+ first = sg;
+ if (last)
+ last->next = sg;
+ last = sg;
+ }
+ last->next = first;
+}
+#endif
+
extern struct sched_drv ingo_sched_drv;
struct sched_drv *scheduler =
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
reply other threads:[~2004-10-30 14:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4183A803.6030406@kolivas.org \
--to=kernel@kolivas.org \
--cc=akpm@osdl.org \
--cc=alexn@dsv.su.se \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=pwil3058@bigpond.net.au \
--cc=wli@holomorphy.com \
/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.