Skip to content

Commit

Permalink
hung_task: decrement sysctl_hung_task_warnings only if it is positive
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tetsuo Handa authored and torvalds committed Dec 13, 2016
1 parent 1270dd8 commit 4ca5ede
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
* complain:
*/
if (sysctl_hung_task_warnings) {
sysctl_hung_task_warnings--;
if (sysctl_hung_task_warnings > 0)
sysctl_hung_task_warnings--;
pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",
t->comm, t->pid, timeout);
pr_err(" %s %s %.*s\n",
Expand Down

0 comments on commit 4ca5ede

Please sign in to comment.