diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 3399701c680e..f385eff4682d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/security.h> | 34 | #include <linux/security.h> |
35 | #include <linux/notifier.h> | 35 | #include <linux/notifier.h> |
36 | #include <linux/profile.h> | 36 | #include <linux/profile.h> |
37 | #include <linux/suspend.h> | 37 | #include <linux/freezer.h> |
38 | #include <linux/vmalloc.h> | 38 | #include <linux/vmalloc.h> |
39 | #include <linux/blkdev.h> | 39 | #include <linux/blkdev.h> |
40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
@@ -505,7 +505,7 @@ static int schedstat_open(struct inode *inode, struct file *file) | |||
505 | return res; | 505 | return res; |
506 | } | 506 | } |
507 | 507 | ||
508 | struct file_operations proc_schedstat_operations = { | 508 | const struct file_operations proc_schedstat_operations = { |
509 | .open = schedstat_open, | 509 | .open = schedstat_open, |
510 | .read = seq_read, | 510 | .read = seq_read, |
511 | .llseek = seq_lseek, | 511 | .llseek = seq_lseek, |
@@ -948,6 +948,17 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local) | |||
948 | } | 948 | } |
949 | #endif | 949 | #endif |
950 | 950 | ||
951 | /* | ||
952 | * Sleep time is in units of nanosecs, so shift by 20 to get a | ||
953 | * milliseconds-range estimation of the amount of time that the task | ||
954 | * spent sleeping: | ||
955 | */ | ||
956 | if (unlikely(prof_on == SLEEP_PROFILING)) { | ||
957 | if (p->state == TASK_UNINTERRUPTIBLE) | ||
958 | profile_hits(SLEEP_PROFILING, (void *)get_wchan(p), | ||
959 | (now - p->timestamp) >> 20); | ||
960 | } | ||
961 | |||
951 | if (!rt_task(p)) | 962 | if (!rt_task(p)) |
952 | p->prio = recalc_task_prio(p, now); | 963 | p->prio = recalc_task_prio(p, now); |
953 | 964 | ||
@@ -3333,6 +3344,7 @@ asmlinkage void __sched schedule(void) | |||
3333 | printk(KERN_ERR "BUG: scheduling while atomic: " | 3344 | printk(KERN_ERR "BUG: scheduling while atomic: " |
3334 | "%s/0x%08x/%d\n", | 3345 | "%s/0x%08x/%d\n", |
3335 | current->comm, preempt_count(), current->pid); | 3346 | current->comm, preempt_count(), current->pid); |
3347 | debug_show_held_locks(current); | ||
3336 | dump_stack(); | 3348 | dump_stack(); |
3337 | } | 3349 | } |
3338 | profile_hit(SCHED_PROFILING, __builtin_return_address(0)); | 3350 | profile_hit(SCHED_PROFILING, __builtin_return_address(0)); |
@@ -4804,18 +4816,18 @@ static void show_task(struct task_struct *p) | |||
4804 | show_stack(p, NULL); | 4816 | show_stack(p, NULL); |
4805 | } | 4817 | } |
4806 | 4818 | ||
4807 | void show_state(void) | 4819 | void show_state_filter(unsigned long state_filter) |
4808 | { | 4820 | { |
4809 | struct task_struct *g, *p; | 4821 | struct task_struct *g, *p; |
4810 | 4822 | ||
4811 | #if (BITS_PER_LONG == 32) | 4823 | #if (BITS_PER_LONG == 32) |
4812 | printk("\n" | 4824 | printk("\n" |
4813 | " sibling\n"); | 4825 | " free sibling\n"); |
4814 | printk(" task PC pid father child younger older\n"); | 4826 | printk(" task PC stack pid father child younger older\n"); |
4815 | #else | 4827 | #else |
4816 | printk("\n" | 4828 | printk("\n" |
4817 | " sibling\n"); | 4829 | " free sibling\n"); |
4818 | printk(" task PC pid father child younger older\n"); | 4830 | printk(" task PC stack pid father child younger older\n"); |
4819 | #endif | 4831 | #endif |
4820 | read_lock(&tasklist_lock); | 4832 | read_lock(&tasklist_lock); |
4821 | do_each_thread(g, p) { | 4833 | do_each_thread(g, p) { |
@@ -4824,11 +4836,16 @@ void show_state(void) | |||
4824 | * console might take alot of time: | 4836 | * console might take alot of time: |
4825 | */ | 4837 | */ |
4826 | touch_nmi_watchdog(); | 4838 | touch_nmi_watchdog(); |
4827 | show_task(p); | 4839 | if (p->state & state_filter) |
4840 | show_task(p); | ||
4828 | } while_each_thread(g, p); | 4841 | } while_each_thread(g, p); |
4829 | 4842 | ||
4830 | read_unlock(&tasklist_lock); | 4843 | read_unlock(&tasklist_lock); |
4831 | debug_show_all_locks(); | 4844 | /* |
4845 | * Only show locks if all tasks are dumped: | ||
4846 | */ | ||
4847 | if (state_filter == -1) | ||
4848 | debug_show_all_locks(); | ||
4832 | } | 4849 | } |
4833 | 4850 | ||
4834 | /** | 4851 | /** |
@@ -6723,8 +6740,6 @@ SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show, | |||
6723 | sched_smt_power_savings_store); | 6740 | sched_smt_power_savings_store); |
6724 | #endif | 6741 | #endif |
6725 | 6742 | ||
6726 | |||
6727 | #ifdef CONFIG_HOTPLUG_CPU | ||
6728 | /* | 6743 | /* |
6729 | * Force a reinitialization of the sched domains hierarchy. The domains | 6744 | * Force a reinitialization of the sched domains hierarchy. The domains |
6730 | * and groups cannot be updated in place without racing with the balancing | 6745 | * and groups cannot be updated in place without racing with the balancing |
@@ -6757,7 +6772,6 @@ static int update_sched_domains(struct notifier_block *nfb, | |||
6757 | 6772 | ||
6758 | return NOTIFY_OK; | 6773 | return NOTIFY_OK; |
6759 | } | 6774 | } |
6760 | #endif | ||
6761 | 6775 | ||
6762 | void __init sched_init_smp(void) | 6776 | void __init sched_init_smp(void) |
6763 | { | 6777 | { |
@@ -6867,6 +6881,7 @@ void __might_sleep(char *file, int line) | |||
6867 | " context at %s:%d\n", file, line); | 6881 | " context at %s:%d\n", file, line); |
6868 | printk("in_atomic():%d, irqs_disabled():%d\n", | 6882 | printk("in_atomic():%d, irqs_disabled():%d\n", |
6869 | in_atomic(), irqs_disabled()); | 6883 | in_atomic(), irqs_disabled()); |
6884 | debug_show_held_locks(current); | ||
6870 | dump_stack(); | 6885 | dump_stack(); |
6871 | } | 6886 | } |
6872 | #endif | 6887 | #endif |