diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2013-10-11 20:39:26 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-11-06 02:49:02 -0500 |
commit | 8b414521bc5375ae8ba18c083af95d44b8da0d04 (patch) | |
tree | dd45ba45e6c397081c838b4dd80e42bc3752ad4f /kernel/hung_task.c | |
parent | d63285e94af3ade4fa8b10b0d9a22bcf72baf2f9 (diff) |
hung_task: add method to reset detector
In certain occasions it is possible for a hung task detector
positive to be false: continuation from a paused VM, for example.
Add a method to reset detection, similar as is done
with other kernel watchdogs.
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'kernel/hung_task.c')
-rw-r--r-- | kernel/hung_task.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 3e97fb126e6b..dfdf51534b3e 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c | |||
@@ -203,6 +203,14 @@ int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | |||
203 | return ret; | 203 | return ret; |
204 | } | 204 | } |
205 | 205 | ||
206 | static atomic_t reset_hung_task = ATOMIC_INIT(0); | ||
207 | |||
208 | void reset_hung_task_detector(void) | ||
209 | { | ||
210 | atomic_set(&reset_hung_task, 1); | ||
211 | } | ||
212 | EXPORT_SYMBOL_GPL(reset_hung_task_detector); | ||
213 | |||
206 | /* | 214 | /* |
207 | * kthread which checks for tasks stuck in D state | 215 | * kthread which checks for tasks stuck in D state |
208 | */ | 216 | */ |
@@ -216,6 +224,9 @@ static int watchdog(void *dummy) | |||
216 | while (schedule_timeout_interruptible(timeout_jiffies(timeout))) | 224 | while (schedule_timeout_interruptible(timeout_jiffies(timeout))) |
217 | timeout = sysctl_hung_task_timeout_secs; | 225 | timeout = sysctl_hung_task_timeout_secs; |
218 | 226 | ||
227 | if (atomic_xchg(&reset_hung_task, 0)) | ||
228 | continue; | ||
229 | |||
219 | check_hung_uninterruptible_tasks(timeout); | 230 | check_hung_uninterruptible_tasks(timeout); |
220 | } | 231 | } |
221 | 232 | ||