diff options
Diffstat (limited to 'kernel/sched/debug.c')
| -rw-r--r-- | kernel/sched/debug.c | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 196559994f7c..5c34d1817e8f 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
| 16 | #include <linux/kallsyms.h> | 16 | #include <linux/kallsyms.h> |
| 17 | #include <linux/utsname.h> | 17 | #include <linux/utsname.h> |
| 18 | #include <linux/mempolicy.h> | ||
| 18 | 19 | ||
| 19 | #include "sched.h" | 20 | #include "sched.h" |
| 20 | 21 | ||
| @@ -137,6 +138,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) | |||
| 137 | SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", | 138 | SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", |
| 138 | 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); | 139 | 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); |
| 139 | #endif | 140 | #endif |
| 141 | #ifdef CONFIG_NUMA_BALANCING | ||
| 142 | SEQ_printf(m, " %d", cpu_to_node(task_cpu(p))); | ||
| 143 | #endif | ||
| 140 | #ifdef CONFIG_CGROUP_SCHED | 144 | #ifdef CONFIG_CGROUP_SCHED |
| 141 | SEQ_printf(m, " %s", task_group_path(task_group(p))); | 145 | SEQ_printf(m, " %s", task_group_path(task_group(p))); |
| 142 | #endif | 146 | #endif |
| @@ -159,7 +163,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu) | |||
| 159 | read_lock_irqsave(&tasklist_lock, flags); | 163 | read_lock_irqsave(&tasklist_lock, flags); |
| 160 | 164 | ||
| 161 | do_each_thread(g, p) { | 165 | do_each_thread(g, p) { |
| 162 | if (!p->on_rq || task_cpu(p) != rq_cpu) | 166 | if (task_cpu(p) != rq_cpu) |
| 163 | continue; | 167 | continue; |
| 164 | 168 | ||
| 165 | print_task(m, rq, p); | 169 | print_task(m, rq, p); |
| @@ -225,6 +229,14 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
| 225 | atomic_read(&cfs_rq->tg->runnable_avg)); | 229 | atomic_read(&cfs_rq->tg->runnable_avg)); |
| 226 | #endif | 230 | #endif |
| 227 | #endif | 231 | #endif |
| 232 | #ifdef CONFIG_CFS_BANDWIDTH | ||
| 233 | SEQ_printf(m, " .%-30s: %d\n", "tg->cfs_bandwidth.timer_active", | ||
| 234 | cfs_rq->tg->cfs_bandwidth.timer_active); | ||
| 235 | SEQ_printf(m, " .%-30s: %d\n", "throttled", | ||
| 236 | cfs_rq->throttled); | ||
| 237 | SEQ_printf(m, " .%-30s: %d\n", "throttle_count", | ||
| 238 | cfs_rq->throttle_count); | ||
| 239 | #endif | ||
| 228 | 240 | ||
| 229 | #ifdef CONFIG_FAIR_GROUP_SCHED | 241 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 230 | print_cfs_group_stats(m, cpu, cfs_rq->tg); | 242 | print_cfs_group_stats(m, cpu, cfs_rq->tg); |
| @@ -345,7 +357,7 @@ static void sched_debug_header(struct seq_file *m) | |||
| 345 | cpu_clk = local_clock(); | 357 | cpu_clk = local_clock(); |
| 346 | local_irq_restore(flags); | 358 | local_irq_restore(flags); |
| 347 | 359 | ||
| 348 | SEQ_printf(m, "Sched Debug Version: v0.10, %s %.*s\n", | 360 | SEQ_printf(m, "Sched Debug Version: v0.11, %s %.*s\n", |
| 349 | init_utsname()->release, | 361 | init_utsname()->release, |
| 350 | (int)strcspn(init_utsname()->version, " "), | 362 | (int)strcspn(init_utsname()->version, " "), |
| 351 | init_utsname()->version); | 363 | init_utsname()->version); |
| @@ -488,6 +500,56 @@ static int __init init_sched_debug_procfs(void) | |||
| 488 | 500 | ||
| 489 | __initcall(init_sched_debug_procfs); | 501 | __initcall(init_sched_debug_procfs); |
| 490 | 502 | ||
| 503 | #define __P(F) \ | ||
| 504 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F) | ||
| 505 | #define P(F) \ | ||
| 506 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F) | ||
| 507 | #define __PN(F) \ | ||
| 508 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F)) | ||
| 509 | #define PN(F) \ | ||
| 510 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F)) | ||
| 511 | |||
| 512 | |||
| 513 | static void sched_show_numa(struct task_struct *p, struct seq_file *m) | ||
| 514 | { | ||
| 515 | #ifdef CONFIG_NUMA_BALANCING | ||
| 516 | struct mempolicy *pol; | ||
| 517 | int node, i; | ||
| 518 | |||
| 519 | if (p->mm) | ||
| 520 | P(mm->numa_scan_seq); | ||
| 521 | |||
| 522 | task_lock(p); | ||
| 523 | pol = p->mempolicy; | ||
| 524 | if (pol && !(pol->flags & MPOL_F_MORON)) | ||
| 525 | pol = NULL; | ||
| 526 | mpol_get(pol); | ||
| 527 | task_unlock(p); | ||
| 528 | |||
| 529 | SEQ_printf(m, "numa_migrations, %ld\n", xchg(&p->numa_pages_migrated, 0)); | ||
| 530 | |||
| 531 | for_each_online_node(node) { | ||
| 532 | for (i = 0; i < 2; i++) { | ||
| 533 | unsigned long nr_faults = -1; | ||
| 534 | int cpu_current, home_node; | ||
| 535 | |||
| 536 | if (p->numa_faults) | ||
| 537 | nr_faults = p->numa_faults[2*node + i]; | ||
| 538 | |||
| 539 | cpu_current = !i ? (task_node(p) == node) : | ||
| 540 | (pol && node_isset(node, pol->v.nodes)); | ||
| 541 | |||
| 542 | home_node = (p->numa_preferred_nid == node); | ||
| 543 | |||
| 544 | SEQ_printf(m, "numa_faults, %d, %d, %d, %d, %ld\n", | ||
| 545 | i, node, cpu_current, home_node, nr_faults); | ||
| 546 | } | ||
| 547 | } | ||
| 548 | |||
| 549 | mpol_put(pol); | ||
| 550 | #endif | ||
| 551 | } | ||
| 552 | |||
| 491 | void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | 553 | void proc_sched_show_task(struct task_struct *p, struct seq_file *m) |
| 492 | { | 554 | { |
| 493 | unsigned long nr_switches; | 555 | unsigned long nr_switches; |
| @@ -591,6 +653,8 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
| 591 | SEQ_printf(m, "%-45s:%21Ld\n", | 653 | SEQ_printf(m, "%-45s:%21Ld\n", |
| 592 | "clock-delta", (long long)(t1-t0)); | 654 | "clock-delta", (long long)(t1-t0)); |
| 593 | } | 655 | } |
| 656 | |||
| 657 | sched_show_numa(p, m); | ||
| 594 | } | 658 | } |
| 595 | 659 | ||
| 596 | void proc_sched_set_task(struct task_struct *p) | 660 | void proc_sched_set_task(struct task_struct *p) |
