aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit2.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-04-02 15:57:03 +0100
committerJan Beulich <jbeulich@novell.com>2011-04-02 15:57:03 +0100
commitd5298187b30d5806deda9088828fd29cad9237da (patch)
treed5306b6c7072fe95344f05751966a2ff60cf8abb /xen/common/sched_credit2.c
parent06490f43250dddc40b4aaf0ff4995991f94e170a (diff)
downloadxen-d5298187b30d5806deda9088828fd29cad9237da.tar.gz
xen-d5298187b30d5806deda9088828fd29cad9237da.tar.bz2
xen-d5298187b30d5806deda9088828fd29cad9237da.zip
move register_cpu_notifier() into .init.text
With no modular drivers, all CPU notifier setup is supposed to happen during boot. There also is a respective comment in the function.=20 Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common/sched_credit2.c')
-rw-r--r--xen/common/sched_credit2.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 12810c3ba4..792d662575 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2010,7 +2010,8 @@ csched_cpu_starting(int cpu)
/* Hope this is safe from cpupools switching things around. :-) */
ops = per_cpu(scheduler, cpu);
- init_pcpu(ops, cpu);
+ if ( ops->alloc_pdata == csched_alloc_pdata )
+ init_pcpu(ops, cpu);
return NOTIFY_DONE;
}
@@ -2038,6 +2039,13 @@ static struct notifier_block cpu_credit2_nfb = {
};
static int
+csched_global_init(void)
+{
+ register_cpu_notifier(&cpu_credit2_nfb);
+ return 0;
+}
+
+static int
csched_init(struct scheduler *ops)
{
int i;
@@ -2070,8 +2078,6 @@ csched_init(struct scheduler *ops)
spin_lock_init(&prv->lock);
INIT_LIST_HEAD(&prv->sdom);
- register_cpu_notifier(&cpu_credit2_nfb);
-
/* But un-initialize all runqueues */
for ( i=0; i<NR_CPUS; i++)
{
@@ -2120,6 +2126,7 @@ const struct scheduler sched_credit2_def = {
.dump_cpu_state = csched_dump_pcpu,
.dump_settings = csched_dump,
+ .global_init = csched_global_init,
.init = csched_init,
.deinit = csched_deinit,
.alloc_vdata = csched_alloc_vdata,