aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-23 05:11:42 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-23 05:11:42 -0400
commitf34bfb1beef8a17ba3d46b60f8fa19ffedc1ed8d (patch)
tree0816c565d26ae24854616faa0d497be365c2fe8b /kernel/sched.c
parentee4311adf105f4d740f52e3948acc1d81598afcc (diff)
parent481c5346d0981940ee63037eb53e4e37b0735c10 (diff)
Merge branch 'linus' into tracing/ftrace
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 96fbbbf3722c..27eaa47d438a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1146,6 +1146,7 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)
1146 return HRTIMER_NORESTART; 1146 return HRTIMER_NORESTART;
1147} 1147}
1148 1148
1149#ifdef CONFIG_SMP
1149static void hotplug_hrtick_disable(int cpu) 1150static void hotplug_hrtick_disable(int cpu)
1150{ 1151{
1151 struct rq *rq = cpu_rq(cpu); 1152 struct rq *rq = cpu_rq(cpu);
@@ -1201,6 +1202,7 @@ static void init_hrtick(void)
1201{ 1202{
1202 hotcpu_notifier(hotplug_hrtick, 0); 1203 hotcpu_notifier(hotplug_hrtick, 0);
1203} 1204}
1205#endif /* CONFIG_SMP */
1204 1206
1205static void init_rq_hrtick(struct rq *rq) 1207static void init_rq_hrtick(struct rq *rq)
1206{ 1208{
@@ -6928,7 +6930,12 @@ static int default_relax_domain_level = -1;
6928 6930
6929static int __init setup_relax_domain_level(char *str) 6931static int __init setup_relax_domain_level(char *str)
6930{ 6932{
6931 default_relax_domain_level = simple_strtoul(str, NULL, 0); 6933 unsigned long val;
6934
6935 val = simple_strtoul(str, NULL, 0);
6936 if (val < SD_LV_MAX)
6937 default_relax_domain_level = val;
6938
6932 return 1; 6939 return 1;
6933} 6940}
6934__setup("relax_domain_level=", setup_relax_domain_level); 6941__setup("relax_domain_level=", setup_relax_domain_level);
@@ -7287,6 +7294,18 @@ void __attribute__((weak)) arch_update_cpu_topology(void)
7287} 7294}
7288 7295
7289/* 7296/*
7297 * Free current domain masks.
7298 * Called after all cpus are attached to NULL domain.
7299 */
7300static void free_sched_domains(void)
7301{
7302 ndoms_cur = 0;
7303 if (doms_cur != &fallback_doms)
7304 kfree(doms_cur);
7305 doms_cur = &fallback_doms;
7306}
7307
7308/*
7290 * Set up scheduler domains and groups. Callers must hold the hotplug lock. 7309 * Set up scheduler domains and groups. Callers must hold the hotplug lock.
7291 * For now this just excludes isolated cpus, but could be used to 7310 * For now this just excludes isolated cpus, but could be used to
7292 * exclude other special cases in the future. 7311 * exclude other special cases in the future.
@@ -7433,6 +7452,7 @@ int arch_reinit_sched_domains(void)
7433 get_online_cpus(); 7452 get_online_cpus();
7434 mutex_lock(&sched_domains_mutex); 7453 mutex_lock(&sched_domains_mutex);
7435 detach_destroy_domains(&cpu_online_map); 7454 detach_destroy_domains(&cpu_online_map);
7455 free_sched_domains();
7436 err = arch_init_sched_domains(&cpu_online_map); 7456 err = arch_init_sched_domains(&cpu_online_map);
7437 mutex_unlock(&sched_domains_mutex); 7457 mutex_unlock(&sched_domains_mutex);
7438 put_online_cpus(); 7458 put_online_cpus();
@@ -7518,6 +7538,7 @@ static int update_sched_domains(struct notifier_block *nfb,
7518 case CPU_DOWN_PREPARE: 7538 case CPU_DOWN_PREPARE:
7519 case CPU_DOWN_PREPARE_FROZEN: 7539 case CPU_DOWN_PREPARE_FROZEN:
7520 detach_destroy_domains(&cpu_online_map); 7540 detach_destroy_domains(&cpu_online_map);
7541 free_sched_domains();
7521 return NOTIFY_OK; 7542 return NOTIFY_OK;
7522 7543
7523 case CPU_UP_CANCELED: 7544 case CPU_UP_CANCELED:
@@ -7536,8 +7557,16 @@ static int update_sched_domains(struct notifier_block *nfb,
7536 return NOTIFY_DONE; 7557 return NOTIFY_DONE;
7537 } 7558 }
7538 7559
7560#ifndef CONFIG_CPUSETS
7561 /*
7562 * Create default domain partitioning if cpusets are disabled.
7563 * Otherwise we let cpusets rebuild the domains based on the
7564 * current setup.
7565 */
7566
7539 /* The hotplug lock is already held by cpu_up/cpu_down */ 7567 /* The hotplug lock is already held by cpu_up/cpu_down */
7540 arch_init_sched_domains(&cpu_online_map); 7568 arch_init_sched_domains(&cpu_online_map);
7569#endif
7541 7570
7542 return NOTIFY_OK; 7571 return NOTIFY_OK;
7543} 7572}
@@ -7677,7 +7706,6 @@ static void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
7677 else 7706 else
7678 rt_se->rt_rq = parent->my_q; 7707 rt_se->rt_rq = parent->my_q;
7679 7708
7680 rt_se->rt_rq = &rq->rt;
7681 rt_se->my_q = rt_rq; 7709 rt_se->my_q = rt_rq;
7682 rt_se->parent = parent; 7710 rt_se->parent = parent;
7683 INIT_LIST_HEAD(&rt_se->run_list); 7711 INIT_LIST_HEAD(&rt_se->run_list);
@@ -8399,7 +8427,7 @@ static unsigned long to_ratio(u64 period, u64 runtime)
8399#ifdef CONFIG_CGROUP_SCHED 8427#ifdef CONFIG_CGROUP_SCHED
8400static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime) 8428static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime)
8401{ 8429{
8402 struct task_group *tgi, *parent = tg->parent; 8430 struct task_group *tgi, *parent = tg ? tg->parent : NULL;
8403 unsigned long total = 0; 8431 unsigned long total = 0;
8404 8432
8405 if (!parent) { 8433 if (!parent) {