Skip to content

Commit 4ca5ede

Browse files
Tetsuo Handatorvalds
Tetsuo Handa
authored andcommitted
hung_task: decrement sysctl_hung_task_warnings only if it is positive
Since sysctl_hung_task_warnings == -1 is allowed (infinite warnings), commit 48a6d64 ("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 <[email protected]> Cc: John Siddle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1270dd8 commit 4ca5ede

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/hung_task.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
106106
* complain:
107107
*/
108108
if (sysctl_hung_task_warnings) {
109-
sysctl_hung_task_warnings--;
109+
if (sysctl_hung_task_warnings > 0)
110+
sysctl_hung_task_warnings--;
110111
pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",
111112
t->comm, t->pid, timeout);
112113
pr_err(" %s %s %.*s\n",

0 commit comments

Comments
 (0)