diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2016-12-12 19:45:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-12 21:55:09 -0500 |
commit | 4ca5ede07c9871c13ae422c96d6d08dbd0df5eda (patch) | |
tree | 71b67a4356f091441bd67074ac41398b50cb323e /kernel/hung_task.c | |
parent | 1270dd8d994039b677d0504ba7260873d608bf75 (diff) |
hung_task: decrement sysctl_hung_task_warnings only if it is positive
Since sysctl_hung_task_warnings == -1 is allowed (infinite warnings),
commit 48a6d64edadb ("hung_task: allow hung_task_panic when
hung_task_warnings is 0") should decrement it only when it is not -1.
This prevents the kernel from ceasing warnings after the first
4294967295 ;)
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: John Siddle <jsiddle@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/hung_task.c')
-rw-r--r-- | kernel/hung_task.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 2b59c82cc3e1..40c07e4fa116 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c | |||
@@ -106,7 +106,8 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) | |||
106 | * complain: | 106 | * complain: |
107 | */ | 107 | */ |
108 | if (sysctl_hung_task_warnings) { | 108 | if (sysctl_hung_task_warnings) { |
109 | sysctl_hung_task_warnings--; | 109 | if (sysctl_hung_task_warnings > 0) |
110 | sysctl_hung_task_warnings--; | ||
110 | pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n", | 111 | pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n", |
111 | t->comm, t->pid, timeout); | 112 | t->comm, t->pid, timeout); |
112 | pr_err(" %s %s %.*s\n", | 113 | pr_err(" %s %s %.*s\n", |