diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-13 10:23:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-13 10:23:15 -0400 |
commit | faafcba3b5e15999cf75d5c5a513ac8e47e2545f (patch) | |
tree | 47d58d1c00e650e820506c91eb9a41268756bdda /arch | |
parent | 13ead805c5a14b0e7ecd34f61404a5bfba655895 (diff) | |
parent | f10e00f4bf360c36edbe6bf18a6c75b171cbe012 (diff) |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar:
"The main changes in this cycle were:
- Optimized support for Intel "Cluster-on-Die" (CoD) topologies (Dave
Hansen)
- Various sched/idle refinements for better idle handling (Nicolas
Pitre, Daniel Lezcano, Chuansheng Liu, Vincent Guittot)
- sched/numa updates and optimizations (Rik van Riel)
- sysbench speedup (Vincent Guittot)
- capacity calculation cleanups/refactoring (Vincent Guittot)
- Various cleanups to thread group iteration (Oleg Nesterov)
- Double-rq-lock removal optimization and various refactorings
(Kirill Tkhai)
- various sched/deadline fixes
... and lots of other changes"
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (72 commits)
sched/dl: Use dl_bw_of() under rcu_read_lock_sched()
sched/fair: Delete resched_cpu() from idle_balance()
sched, time: Fix build error with 64 bit cputime_t on 32 bit systems
sched: Improve sysbench performance by fixing spurious active migration
sched/x86: Fix up typo in topology detection
x86, sched: Add new topology for multi-NUMA-node CPUs
sched/rt: Use resched_curr() in task_tick_rt()
sched: Use rq->rd in sched_setaffinity() under RCU read lock
sched: cleanup: Rename 'out_unlock' to 'out_free_new_mask'
sched: Use dl_bw_of() under RCU read lock
sched/fair: Remove duplicate code from can_migrate_task()
sched, mips, ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW
sched: print_rq(): Don't use tasklist_lock
sched: normalize_rt_tasks(): Don't use _irqsave for tasklist_lock, use task_rq_lock()
sched: Fix the task-group check in tg_has_rt_tasks()
sched/fair: Leverage the idle state info when choosing the "idlest" cpu
sched: Let the scheduler see CPU idle states
sched/deadline: Fix inter- exclusive cpusets migrations
sched/deadline: Clear dl_entity params when setscheduling to different class
sched/numa: Kill the wrong/dead TASK_DEAD check in task_numa_fault()
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/topology.c | 4 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/sync_serial.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 1 | ||||
-rw-r--r-- | arch/ia64/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/mips/include/asm/processor.h | 6 | ||||
-rw-r--r-- | arch/powerpc/include/asm/cputime.h | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/fault.c | 5 | ||||
-rw-r--r-- | arch/s390/include/asm/cputime.h | 2 | ||||
-rw-r--r-- | arch/um/drivers/random.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 55 | ||||
-rw-r--r-- | arch/x86/mm/fault.c | 5 |
11 files changed, 54 insertions, 29 deletions
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index e35d880f9773..89cfdd6e50cb 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c | |||
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | static DEFINE_PER_CPU(unsigned long, cpu_scale); | 43 | static DEFINE_PER_CPU(unsigned long, cpu_scale); |
44 | 44 | ||
45 | unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu) | 45 | unsigned long arch_scale_cpu_capacity(struct sched_domain *sd, int cpu) |
46 | { | 46 | { |
47 | return per_cpu(cpu_scale, cpu); | 47 | return per_cpu(cpu_scale, cpu); |
48 | } | 48 | } |
@@ -166,7 +166,7 @@ static void update_cpu_capacity(unsigned int cpu) | |||
166 | set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); | 166 | set_capacity_scale(cpu, cpu_capacity(cpu) / middle_capacity); |
167 | 167 | ||
168 | printk(KERN_INFO "CPU%u: update cpu_capacity %lu\n", | 168 | printk(KERN_INFO "CPU%u: update cpu_capacity %lu\n", |
169 | cpu, arch_scale_freq_capacity(NULL, cpu)); | 169 | cpu, arch_scale_cpu_capacity(NULL, cpu)); |
170 | } | 170 | } |
171 | 171 | ||
172 | #else | 172 | #else |
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index 29eb02ab3f25..0f3983241e60 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -1086,7 +1086,6 @@ static ssize_t sync_serial_write(struct file *file, const char *buf, | |||
1086 | } | 1086 | } |
1087 | local_irq_restore(flags); | 1087 | local_irq_restore(flags); |
1088 | schedule(); | 1088 | schedule(); |
1089 | set_current_state(TASK_RUNNING); | ||
1090 | remove_wait_queue(&port->out_wait_q, &wait); | 1089 | remove_wait_queue(&port->out_wait_q, &wait); |
1091 | if (signal_pending(current)) | 1090 | if (signal_pending(current)) |
1092 | return -EINTR; | 1091 | return -EINTR; |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index bbb806b68838..5a149134cfb5 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -1089,7 +1089,6 @@ static ssize_t sync_serial_write(struct file *file, const char *buf, | |||
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | schedule(); | 1091 | schedule(); |
1092 | set_current_state(TASK_RUNNING); | ||
1093 | remove_wait_queue(&port->out_wait_q, &wait); | 1092 | remove_wait_queue(&port->out_wait_q, &wait); |
1094 | 1093 | ||
1095 | if (signal_pending(current)) | 1094 | if (signal_pending(current)) |
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h index c7367130ab14..ce53c50d0ba4 100644 --- a/arch/ia64/include/asm/processor.h +++ b/arch/ia64/include/asm/processor.h | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
20 | #include <asm/ustack.h> | 20 | #include <asm/ustack.h> |
21 | 21 | ||
22 | #define __ARCH_WANT_UNLOCKED_CTXSW | ||
23 | #define ARCH_HAS_PREFETCH_SWITCH_STACK | 22 | #define ARCH_HAS_PREFETCH_SWITCH_STACK |
24 | 23 | ||
25 | #define IA64_NUM_PHYS_STACK_REG 96 | 24 | #define IA64_NUM_PHYS_STACK_REG 96 |
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 05f08438a7c4..f1df4cb4a286 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h | |||
@@ -397,12 +397,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
397 | #define ARCH_HAS_PREFETCHW | 397 | #define ARCH_HAS_PREFETCHW |
398 | #define prefetchw(x) __builtin_prefetch((x), 1, 1) | 398 | #define prefetchw(x) __builtin_prefetch((x), 1, 1) |
399 | 399 | ||
400 | /* | ||
401 | * See Documentation/scheduler/sched-arch.txt; prevents deadlock on SMP | ||
402 | * systems. | ||
403 | */ | ||
404 | #define __ARCH_WANT_UNLOCKED_CTXSW | ||
405 | |||
406 | #endif | 400 | #endif |
407 | 401 | ||
408 | #endif /* _ASM_PROCESSOR_H */ | 402 | #endif /* _ASM_PROCESSOR_H */ |
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 607559ab271f..6c840ceab820 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h | |||
@@ -32,6 +32,8 @@ static inline void setup_cputime_one_jiffy(void) { } | |||
32 | typedef u64 __nocast cputime_t; | 32 | typedef u64 __nocast cputime_t; |
33 | typedef u64 __nocast cputime64_t; | 33 | typedef u64 __nocast cputime64_t; |
34 | 34 | ||
35 | #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new) | ||
36 | |||
35 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
36 | 38 | ||
37 | /* | 39 | /* |
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 24b3f4949df4..08d659a9fcdb 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/kprobes.h> | 30 | #include <linux/kprobes.h> |
31 | #include <linux/kdebug.h> | 31 | #include <linux/kdebug.h> |
32 | #include <linux/perf_event.h> | 32 | #include <linux/perf_event.h> |
33 | #include <linux/magic.h> | ||
34 | #include <linux/ratelimit.h> | 33 | #include <linux/ratelimit.h> |
35 | #include <linux/context_tracking.h> | 34 | #include <linux/context_tracking.h> |
36 | #include <linux/hugetlb.h> | 35 | #include <linux/hugetlb.h> |
@@ -521,7 +520,6 @@ bail: | |||
521 | void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) | 520 | void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) |
522 | { | 521 | { |
523 | const struct exception_table_entry *entry; | 522 | const struct exception_table_entry *entry; |
524 | unsigned long *stackend; | ||
525 | 523 | ||
526 | /* Are we prepared to handle this fault? */ | 524 | /* Are we prepared to handle this fault? */ |
527 | if ((entry = search_exception_tables(regs->nip)) != NULL) { | 525 | if ((entry = search_exception_tables(regs->nip)) != NULL) { |
@@ -550,8 +548,7 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) | |||
550 | printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n", | 548 | printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n", |
551 | regs->nip); | 549 | regs->nip); |
552 | 550 | ||
553 | stackend = end_of_stack(current); | 551 | if (task_stack_end_corrupted(current)) |
554 | if (current != &init_task && *stackend != STACK_END_MAGIC) | ||
555 | printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); | 552 | printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); |
556 | 553 | ||
557 | die("Kernel access of bad area", regs, sig); | 554 | die("Kernel access of bad area", regs, sig); |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index f65bd3634519..3001887f94b7 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -18,6 +18,8 @@ | |||
18 | typedef unsigned long long __nocast cputime_t; | 18 | typedef unsigned long long __nocast cputime_t; |
19 | typedef unsigned long long __nocast cputime64_t; | 19 | typedef unsigned long long __nocast cputime64_t; |
20 | 20 | ||
21 | #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new) | ||
22 | |||
21 | static inline unsigned long __div(unsigned long long n, unsigned long base) | 23 | static inline unsigned long __div(unsigned long long n, unsigned long base) |
22 | { | 24 | { |
23 | #ifndef CONFIG_64BIT | 25 | #ifndef CONFIG_64BIT |
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c index 9e3a72205827..dd16c902ff70 100644 --- a/arch/um/drivers/random.c +++ b/arch/um/drivers/random.c | |||
@@ -79,7 +79,6 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size, | |||
79 | set_task_state(current, TASK_INTERRUPTIBLE); | 79 | set_task_state(current, TASK_INTERRUPTIBLE); |
80 | 80 | ||
81 | schedule(); | 81 | schedule(); |
82 | set_task_state(current, TASK_RUNNING); | ||
83 | remove_wait_queue(&host_read_wait, &wait); | 82 | remove_wait_queue(&host_read_wait, &wait); |
84 | 83 | ||
85 | if (atomic_dec_and_test(&host_sleep_count)) { | 84 | if (atomic_dec_and_test(&host_sleep_count)) { |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 42a2dca984b3..9b1c0f8f68e6 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -296,11 +296,19 @@ void smp_store_cpu_info(int id) | |||
296 | } | 296 | } |
297 | 297 | ||
298 | static bool | 298 | static bool |
299 | topology_same_node(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | ||
300 | { | ||
301 | int cpu1 = c->cpu_index, cpu2 = o->cpu_index; | ||
302 | |||
303 | return (cpu_to_node(cpu1) == cpu_to_node(cpu2)); | ||
304 | } | ||
305 | |||
306 | static bool | ||
299 | topology_sane(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o, const char *name) | 307 | topology_sane(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o, const char *name) |
300 | { | 308 | { |
301 | int cpu1 = c->cpu_index, cpu2 = o->cpu_index; | 309 | int cpu1 = c->cpu_index, cpu2 = o->cpu_index; |
302 | 310 | ||
303 | return !WARN_ONCE(cpu_to_node(cpu1) != cpu_to_node(cpu2), | 311 | return !WARN_ONCE(!topology_same_node(c, o), |
304 | "sched: CPU #%d's %s-sibling CPU #%d is not on the same node! " | 312 | "sched: CPU #%d's %s-sibling CPU #%d is not on the same node! " |
305 | "[node: %d != %d]. Ignoring dependency.\n", | 313 | "[node: %d != %d]. Ignoring dependency.\n", |
306 | cpu1, name, cpu2, cpu_to_node(cpu1), cpu_to_node(cpu2)); | 314 | cpu1, name, cpu2, cpu_to_node(cpu1), cpu_to_node(cpu2)); |
@@ -341,17 +349,44 @@ static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | |||
341 | return false; | 349 | return false; |
342 | } | 350 | } |
343 | 351 | ||
344 | static bool match_mc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | 352 | /* |
353 | * Unlike the other levels, we do not enforce keeping a | ||
354 | * multicore group inside a NUMA node. If this happens, we will | ||
355 | * discard the MC level of the topology later. | ||
356 | */ | ||
357 | static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | ||
345 | { | 358 | { |
346 | if (c->phys_proc_id == o->phys_proc_id) { | 359 | if (c->phys_proc_id == o->phys_proc_id) |
347 | if (cpu_has(c, X86_FEATURE_AMD_DCM)) | 360 | return true; |
348 | return true; | ||
349 | |||
350 | return topology_sane(c, o, "mc"); | ||
351 | } | ||
352 | return false; | 361 | return false; |
353 | } | 362 | } |
354 | 363 | ||
364 | static struct sched_domain_topology_level numa_inside_package_topology[] = { | ||
365 | #ifdef CONFIG_SCHED_SMT | ||
366 | { cpu_smt_mask, cpu_smt_flags, SD_INIT_NAME(SMT) }, | ||
367 | #endif | ||
368 | #ifdef CONFIG_SCHED_MC | ||
369 | { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, | ||
370 | #endif | ||
371 | { NULL, }, | ||
372 | }; | ||
373 | /* | ||
374 | * set_sched_topology() sets the topology internal to a CPU. The | ||
375 | * NUMA topologies are layered on top of it to build the full | ||
376 | * system topology. | ||
377 | * | ||
378 | * If NUMA nodes are observed to occur within a CPU package, this | ||
379 | * function should be called. It forces the sched domain code to | ||
380 | * only use the SMT level for the CPU portion of the topology. | ||
381 | * This essentially falls back to relying on NUMA information | ||
382 | * from the SRAT table to describe the entire system topology | ||
383 | * (except for hyperthreads). | ||
384 | */ | ||
385 | static void primarily_use_numa_for_topology(void) | ||
386 | { | ||
387 | set_sched_topology(numa_inside_package_topology); | ||
388 | } | ||
389 | |||
355 | void set_cpu_sibling_map(int cpu) | 390 | void set_cpu_sibling_map(int cpu) |
356 | { | 391 | { |
357 | bool has_smt = smp_num_siblings > 1; | 392 | bool has_smt = smp_num_siblings > 1; |
@@ -388,7 +423,7 @@ void set_cpu_sibling_map(int cpu) | |||
388 | for_each_cpu(i, cpu_sibling_setup_mask) { | 423 | for_each_cpu(i, cpu_sibling_setup_mask) { |
389 | o = &cpu_data(i); | 424 | o = &cpu_data(i); |
390 | 425 | ||
391 | if ((i == cpu) || (has_mp && match_mc(c, o))) { | 426 | if ((i == cpu) || (has_mp && match_die(c, o))) { |
392 | link_mask(core, cpu, i); | 427 | link_mask(core, cpu, i); |
393 | 428 | ||
394 | /* | 429 | /* |
@@ -410,6 +445,8 @@ void set_cpu_sibling_map(int cpu) | |||
410 | } else if (i != cpu && !c->booted_cores) | 445 | } else if (i != cpu && !c->booted_cores) |
411 | c->booted_cores = cpu_data(i).booted_cores; | 446 | c->booted_cores = cpu_data(i).booted_cores; |
412 | } | 447 | } |
448 | if (match_die(c, o) && !topology_same_node(c, o)) | ||
449 | primarily_use_numa_for_topology(); | ||
413 | } | 450 | } |
414 | } | 451 | } |
415 | 452 | ||
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 83bb03bfa259..9c5b32e2bdc0 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -3,7 +3,6 @@ | |||
3 | * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs. | 3 | * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs. |
4 | * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar | 4 | * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar |
5 | */ | 5 | */ |
6 | #include <linux/magic.h> /* STACK_END_MAGIC */ | ||
7 | #include <linux/sched.h> /* test_thread_flag(), ... */ | 6 | #include <linux/sched.h> /* test_thread_flag(), ... */ |
8 | #include <linux/kdebug.h> /* oops_begin/end, ... */ | 7 | #include <linux/kdebug.h> /* oops_begin/end, ... */ |
9 | #include <linux/module.h> /* search_exception_table */ | 8 | #include <linux/module.h> /* search_exception_table */ |
@@ -649,7 +648,6 @@ no_context(struct pt_regs *regs, unsigned long error_code, | |||
649 | unsigned long address, int signal, int si_code) | 648 | unsigned long address, int signal, int si_code) |
650 | { | 649 | { |
651 | struct task_struct *tsk = current; | 650 | struct task_struct *tsk = current; |
652 | unsigned long *stackend; | ||
653 | unsigned long flags; | 651 | unsigned long flags; |
654 | int sig; | 652 | int sig; |
655 | 653 | ||
@@ -709,8 +707,7 @@ no_context(struct pt_regs *regs, unsigned long error_code, | |||
709 | 707 | ||
710 | show_fault_oops(regs, error_code, address); | 708 | show_fault_oops(regs, error_code, address); |
711 | 709 | ||
712 | stackend = end_of_stack(tsk); | 710 | if (task_stack_end_corrupted(tsk)) |
713 | if (tsk != &init_task && *stackend != STACK_END_MAGIC) | ||
714 | printk(KERN_EMERG "Thread overran stack, or stack corrupted\n"); | 711 | printk(KERN_EMERG "Thread overran stack, or stack corrupted\n"); |
715 | 712 | ||
716 | tsk->thread.cr2 = address; | 713 | tsk->thread.cr2 = address; |