diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index bb2c699c9f5e..b048ad8a11af 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1127,6 +1127,7 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer) | |||
1127 | return HRTIMER_NORESTART; | 1127 | return HRTIMER_NORESTART; |
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | #ifdef CONFIG_SMP | ||
1130 | static void hotplug_hrtick_disable(int cpu) | 1131 | static void hotplug_hrtick_disable(int cpu) |
1131 | { | 1132 | { |
1132 | struct rq *rq = cpu_rq(cpu); | 1133 | struct rq *rq = cpu_rq(cpu); |
@@ -1182,6 +1183,7 @@ static void init_hrtick(void) | |||
1182 | { | 1183 | { |
1183 | hotcpu_notifier(hotplug_hrtick, 0); | 1184 | hotcpu_notifier(hotplug_hrtick, 0); |
1184 | } | 1185 | } |
1186 | #endif /* CONFIG_SMP */ | ||
1185 | 1187 | ||
1186 | static void init_rq_hrtick(struct rq *rq) | 1188 | static void init_rq_hrtick(struct rq *rq) |
1187 | { | 1189 | { |
@@ -7241,6 +7243,18 @@ void __attribute__((weak)) arch_update_cpu_topology(void) | |||
7241 | } | 7243 | } |
7242 | 7244 | ||
7243 | /* | 7245 | /* |
7246 | * Free current domain masks. | ||
7247 | * Called after all cpus are attached to NULL domain. | ||
7248 | */ | ||
7249 | static void free_sched_domains(void) | ||
7250 | { | ||
7251 | ndoms_cur = 0; | ||
7252 | if (doms_cur != &fallback_doms) | ||
7253 | kfree(doms_cur); | ||
7254 | doms_cur = &fallback_doms; | ||
7255 | } | ||
7256 | |||
7257 | /* | ||
7244 | * Set up scheduler domains and groups. Callers must hold the hotplug lock. | 7258 | * Set up scheduler domains and groups. Callers must hold the hotplug lock. |
7245 | * For now this just excludes isolated cpus, but could be used to | 7259 | * For now this just excludes isolated cpus, but could be used to |
7246 | * exclude other special cases in the future. | 7260 | * exclude other special cases in the future. |
@@ -7387,6 +7401,7 @@ int arch_reinit_sched_domains(void) | |||
7387 | get_online_cpus(); | 7401 | get_online_cpus(); |
7388 | mutex_lock(&sched_domains_mutex); | 7402 | mutex_lock(&sched_domains_mutex); |
7389 | detach_destroy_domains(&cpu_online_map); | 7403 | detach_destroy_domains(&cpu_online_map); |
7404 | free_sched_domains(); | ||
7390 | err = arch_init_sched_domains(&cpu_online_map); | 7405 | err = arch_init_sched_domains(&cpu_online_map); |
7391 | mutex_unlock(&sched_domains_mutex); | 7406 | mutex_unlock(&sched_domains_mutex); |
7392 | put_online_cpus(); | 7407 | put_online_cpus(); |
@@ -7472,6 +7487,7 @@ static int update_sched_domains(struct notifier_block *nfb, | |||
7472 | case CPU_DOWN_PREPARE: | 7487 | case CPU_DOWN_PREPARE: |
7473 | case CPU_DOWN_PREPARE_FROZEN: | 7488 | case CPU_DOWN_PREPARE_FROZEN: |
7474 | detach_destroy_domains(&cpu_online_map); | 7489 | detach_destroy_domains(&cpu_online_map); |
7490 | free_sched_domains(); | ||
7475 | return NOTIFY_OK; | 7491 | return NOTIFY_OK; |
7476 | 7492 | ||
7477 | case CPU_UP_CANCELED: | 7493 | case CPU_UP_CANCELED: |
@@ -7490,8 +7506,16 @@ static int update_sched_domains(struct notifier_block *nfb, | |||
7490 | return NOTIFY_DONE; | 7506 | return NOTIFY_DONE; |
7491 | } | 7507 | } |
7492 | 7508 | ||
7509 | #ifndef CONFIG_CPUSETS | ||
7510 | /* | ||
7511 | * Create default domain partitioning if cpusets are disabled. | ||
7512 | * Otherwise we let cpusets rebuild the domains based on the | ||
7513 | * current setup. | ||
7514 | */ | ||
7515 | |||
7493 | /* The hotplug lock is already held by cpu_up/cpu_down */ | 7516 | /* The hotplug lock is already held by cpu_up/cpu_down */ |
7494 | arch_init_sched_domains(&cpu_online_map); | 7517 | arch_init_sched_domains(&cpu_online_map); |
7518 | #endif | ||
7495 | 7519 | ||
7496 | return NOTIFY_OK; | 7520 | return NOTIFY_OK; |
7497 | } | 7521 | } |
@@ -7631,7 +7655,6 @@ static void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq, | |||
7631 | else | 7655 | else |
7632 | rt_se->rt_rq = parent->my_q; | 7656 | rt_se->rt_rq = parent->my_q; |
7633 | 7657 | ||
7634 | rt_se->rt_rq = &rq->rt; | ||
7635 | rt_se->my_q = rt_rq; | 7658 | rt_se->my_q = rt_rq; |
7636 | rt_se->parent = parent; | 7659 | rt_se->parent = parent; |
7637 | INIT_LIST_HEAD(&rt_se->run_list); | 7660 | INIT_LIST_HEAD(&rt_se->run_list); |
@@ -8353,7 +8376,7 @@ static unsigned long to_ratio(u64 period, u64 runtime) | |||
8353 | #ifdef CONFIG_CGROUP_SCHED | 8376 | #ifdef CONFIG_CGROUP_SCHED |
8354 | static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime) | 8377 | static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime) |
8355 | { | 8378 | { |
8356 | struct task_group *tgi, *parent = tg->parent; | 8379 | struct task_group *tgi, *parent = tg ? tg->parent : NULL; |
8357 | unsigned long total = 0; | 8380 | unsigned long total = 0; |
8358 | 8381 | ||
8359 | if (!parent) { | 8382 | if (!parent) { |