|
@@ -7292,6 +7292,18 @@ void __attribute__((weak)) arch_update_cpu_topology(void)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * Free current domain masks.
|
|
|
|
+ * Called after all cpus are attached to NULL domain.
|
|
|
|
+ */
|
|
|
|
+static void free_sched_domains(void)
|
|
|
|
+{
|
|
|
|
+ ndoms_cur = 0;
|
|
|
|
+ if (doms_cur != &fallback_doms)
|
|
|
|
+ kfree(doms_cur);
|
|
|
|
+ doms_cur = &fallback_doms;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Set up scheduler domains and groups. Callers must hold the hotplug lock.
|
|
* Set up scheduler domains and groups. Callers must hold the hotplug lock.
|
|
* For now this just excludes isolated cpus, but could be used to
|
|
* For now this just excludes isolated cpus, but could be used to
|
|
@@ -7439,6 +7451,7 @@ int arch_reinit_sched_domains(void)
|
|
get_online_cpus();
|
|
get_online_cpus();
|
|
mutex_lock(&sched_domains_mutex);
|
|
mutex_lock(&sched_domains_mutex);
|
|
detach_destroy_domains(&cpu_online_map);
|
|
detach_destroy_domains(&cpu_online_map);
|
|
|
|
+ free_sched_domains();
|
|
err = arch_init_sched_domains(&cpu_online_map);
|
|
err = arch_init_sched_domains(&cpu_online_map);
|
|
mutex_unlock(&sched_domains_mutex);
|
|
mutex_unlock(&sched_domains_mutex);
|
|
put_online_cpus();
|
|
put_online_cpus();
|
|
@@ -7524,6 +7537,7 @@ static int update_sched_domains(struct notifier_block *nfb,
|
|
case CPU_DOWN_PREPARE:
|
|
case CPU_DOWN_PREPARE:
|
|
case CPU_DOWN_PREPARE_FROZEN:
|
|
case CPU_DOWN_PREPARE_FROZEN:
|
|
detach_destroy_domains(&cpu_online_map);
|
|
detach_destroy_domains(&cpu_online_map);
|
|
|
|
+ free_sched_domains();
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
|
|
|
|
case CPU_UP_CANCELED:
|
|
case CPU_UP_CANCELED:
|
|
@@ -7542,8 +7556,16 @@ static int update_sched_domains(struct notifier_block *nfb,
|
|
return NOTIFY_DONE;
|
|
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 */
|
|
/* The hotplug lock is already held by cpu_up/cpu_down */
|
|
arch_init_sched_domains(&cpu_online_map);
|
|
arch_init_sched_domains(&cpu_online_map);
|
|
|
|
+#endif
|
|
|
|
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
}
|
|
}
|