diff options
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | kernel/rcuclassic.c | 2 | ||||
-rw-r--r-- | kernel/sched.c | 7 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 10 |
4 files changed, 12 insertions, 9 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index c5be6c6bc741..1e33e2cb7f8c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -249,7 +249,7 @@ extern void init_idle_bootup_task(struct task_struct *idle); | |||
249 | extern int runqueue_is_locked(void); | 249 | extern int runqueue_is_locked(void); |
250 | extern void task_rq_unlock_wait(struct task_struct *p); | 250 | extern void task_rq_unlock_wait(struct task_struct *p); |
251 | 251 | ||
252 | extern cpumask_t nohz_cpu_mask; | 252 | extern cpumask_var_t nohz_cpu_mask; |
253 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 253 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
254 | extern int select_nohz_load_balancer(int cpu); | 254 | extern int select_nohz_load_balancer(int cpu); |
255 | #else | 255 | #else |
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index e503a002f330..c03ca3e61919 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c | |||
@@ -393,7 +393,7 @@ static void rcu_start_batch(struct rcu_ctrlblk *rcp) | |||
393 | * unnecessarily. | 393 | * unnecessarily. |
394 | */ | 394 | */ |
395 | smp_mb(); | 395 | smp_mb(); |
396 | cpus_andnot(rcp->cpumask, cpu_online_map, nohz_cpu_mask); | 396 | cpumask_andnot(&rcp->cpumask, cpu_online_mask, nohz_cpu_mask); |
397 | 397 | ||
398 | rcp->signaled = 0; | 398 | rcp->signaled = 0; |
399 | } | 399 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index 6b9606a6cabf..2723d7a4a42d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -5870,9 +5870,9 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu) | |||
5870 | * indicates which cpus entered this state. This is used | 5870 | * indicates which cpus entered this state. This is used |
5871 | * in the rcu update to wait only for active cpus. For system | 5871 | * in the rcu update to wait only for active cpus. For system |
5872 | * which do not switch off the HZ timer nohz_cpu_mask should | 5872 | * which do not switch off the HZ timer nohz_cpu_mask should |
5873 | * always be CPU_MASK_NONE. | 5873 | * always be CPU_BITS_NONE. |
5874 | */ | 5874 | */ |
5875 | cpumask_t nohz_cpu_mask = CPU_MASK_NONE; | 5875 | cpumask_var_t nohz_cpu_mask; |
5876 | 5876 | ||
5877 | /* | 5877 | /* |
5878 | * Increase the granularity value when there are more CPUs, | 5878 | * Increase the granularity value when there are more CPUs, |
@@ -8274,6 +8274,9 @@ void __init sched_init(void) | |||
8274 | */ | 8274 | */ |
8275 | current->sched_class = &fair_sched_class; | 8275 | current->sched_class = &fair_sched_class; |
8276 | 8276 | ||
8277 | /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ | ||
8278 | alloc_bootmem_cpumask_var(&nohz_cpu_mask); | ||
8279 | |||
8277 | scheduler_running = 1; | 8280 | scheduler_running = 1; |
8278 | } | 8281 | } |
8279 | 8282 | ||
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 342fc9ccab46..70f872c71f4e 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -144,7 +144,7 @@ void tick_nohz_update_jiffies(void) | |||
144 | if (!ts->tick_stopped) | 144 | if (!ts->tick_stopped) |
145 | return; | 145 | return; |
146 | 146 | ||
147 | cpu_clear(cpu, nohz_cpu_mask); | 147 | cpumask_clear_cpu(cpu, nohz_cpu_mask); |
148 | now = ktime_get(); | 148 | now = ktime_get(); |
149 | ts->idle_waketime = now; | 149 | ts->idle_waketime = now; |
150 | 150 | ||
@@ -283,7 +283,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
283 | if ((long)delta_jiffies >= 1) { | 283 | if ((long)delta_jiffies >= 1) { |
284 | 284 | ||
285 | if (delta_jiffies > 1) | 285 | if (delta_jiffies > 1) |
286 | cpu_set(cpu, nohz_cpu_mask); | 286 | cpumask_set_cpu(cpu, nohz_cpu_mask); |
287 | /* | 287 | /* |
288 | * nohz_stop_sched_tick can be called several times before | 288 | * nohz_stop_sched_tick can be called several times before |
289 | * the nohz_restart_sched_tick is called. This happens when | 289 | * the nohz_restart_sched_tick is called. This happens when |
@@ -296,7 +296,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
296 | /* | 296 | /* |
297 | * sched tick not stopped! | 297 | * sched tick not stopped! |
298 | */ | 298 | */ |
299 | cpu_clear(cpu, nohz_cpu_mask); | 299 | cpumask_clear_cpu(cpu, nohz_cpu_mask); |
300 | goto out; | 300 | goto out; |
301 | } | 301 | } |
302 | 302 | ||
@@ -354,7 +354,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
354 | * softirq. | 354 | * softirq. |
355 | */ | 355 | */ |
356 | tick_do_update_jiffies64(ktime_get()); | 356 | tick_do_update_jiffies64(ktime_get()); |
357 | cpu_clear(cpu, nohz_cpu_mask); | 357 | cpumask_clear_cpu(cpu, nohz_cpu_mask); |
358 | } | 358 | } |
359 | raise_softirq_irqoff(TIMER_SOFTIRQ); | 359 | raise_softirq_irqoff(TIMER_SOFTIRQ); |
360 | out: | 360 | out: |
@@ -432,7 +432,7 @@ void tick_nohz_restart_sched_tick(void) | |||
432 | select_nohz_load_balancer(0); | 432 | select_nohz_load_balancer(0); |
433 | now = ktime_get(); | 433 | now = ktime_get(); |
434 | tick_do_update_jiffies64(now); | 434 | tick_do_update_jiffies64(now); |
435 | cpu_clear(cpu, nohz_cpu_mask); | 435 | cpumask_clear_cpu(cpu, nohz_cpu_mask); |
436 | 436 | ||
437 | /* | 437 | /* |
438 | * We stopped the tick in idle. Update process times would miss the | 438 | * We stopped the tick in idle. Update process times would miss the |