diff options
Diffstat (limited to 'kernel/hung_task.c')
-rw-r--r-- | kernel/hung_task.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 3e97fb126e6b..9328b80eaf14 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c | |||
@@ -16,11 +16,12 @@ | |||
16 | #include <linux/export.h> | 16 | #include <linux/export.h> |
17 | #include <linux/sysctl.h> | 17 | #include <linux/sysctl.h> |
18 | #include <linux/utsname.h> | 18 | #include <linux/utsname.h> |
19 | #include <trace/events/sched.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * The number of tasks checked: | 22 | * The number of tasks checked: |
22 | */ | 23 | */ |
23 | unsigned long __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; | 24 | int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; |
24 | 25 | ||
25 | /* | 26 | /* |
26 | * Limit number of tasks checked in a batch. | 27 | * Limit number of tasks checked in a batch. |
@@ -92,6 +93,9 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) | |||
92 | t->last_switch_count = switch_count; | 93 | t->last_switch_count = switch_count; |
93 | return; | 94 | return; |
94 | } | 95 | } |
96 | |||
97 | trace_sched_process_hang(t); | ||
98 | |||
95 | if (!sysctl_hung_task_warnings) | 99 | if (!sysctl_hung_task_warnings) |
96 | return; | 100 | return; |
97 | sysctl_hung_task_warnings--; | 101 | sysctl_hung_task_warnings--; |
@@ -203,6 +207,14 @@ int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | |||
203 | return ret; | 207 | return ret; |
204 | } | 208 | } |
205 | 209 | ||
210 | static atomic_t reset_hung_task = ATOMIC_INIT(0); | ||
211 | |||
212 | void reset_hung_task_detector(void) | ||
213 | { | ||
214 | atomic_set(&reset_hung_task, 1); | ||
215 | } | ||
216 | EXPORT_SYMBOL_GPL(reset_hung_task_detector); | ||
217 | |||
206 | /* | 218 | /* |
207 | * kthread which checks for tasks stuck in D state | 219 | * kthread which checks for tasks stuck in D state |
208 | */ | 220 | */ |
@@ -216,6 +228,9 @@ static int watchdog(void *dummy) | |||
216 | while (schedule_timeout_interruptible(timeout_jiffies(timeout))) | 228 | while (schedule_timeout_interruptible(timeout_jiffies(timeout))) |
217 | timeout = sysctl_hung_task_timeout_secs; | 229 | timeout = sysctl_hung_task_timeout_secs; |
218 | 230 | ||
231 | if (atomic_xchg(&reset_hung_task, 0)) | ||
232 | continue; | ||
233 | |||
219 | check_hung_uninterruptible_tasks(timeout); | 234 | check_hung_uninterruptible_tasks(timeout); |
220 | } | 235 | } |
221 | 236 | ||