Skip to contentSkip to conversation

check_hung_task(): unsigned sysctl_hung_task_warnings cannot be less than 0

PATCH Applied Roel Kluin 2 participants 2 messages Dec 2, 2008 – Dec 3, 2008

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 check_hung_task(): unsigned sysctl_hung_task_warnings cannot be less than 0

unsigned sysctl_hung_task_warnings cannot be less than 0

---
in kernel/softlockup.c

unsigned long __read_mostly sysctl_hung_task_warnings = 10;
...
static void check_hung_task()
{
...
if (sysctl_hung_task_warnings < 0)
return
sysctl_hung_task_warnings--;

kernel/softlockup.c +1 -1
index 3953e4a..a50a5db 100644
@@ -188,7 +188,7 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
 	if ((long)(now - t->last_switch_timestamp) <
 					sysctl_hung_task_timeout_secs)
 		return;
-	if (sysctl_hung_task_warnings < 0)
+	if (sysctl_hung_task_warnings == -1)
 		return;
 	sysctl_hung_task_warnings--;
 
Applied
#1 lore raw
Quoted 6 lines · Roel Kluin

unsigned sysctl_hung_task_warnings cannot be less than 0

---
in kernel/softlockup.c

Quoted 8 lines

unsigned long __read_mostly sysctl_hung_task_warnings = 10;
...
static void check_hung_task()
{
...
if (sysctl_hung_task_warnings < 0)
return
sysctl_hung_task_warnings--;

applied to tip/core/urgent, thanks Roel!

Note, i changed the check to !0 instead - see below.

Ingo

-------------->

Quoted 1 line

From 201955463a5c1a70d3f70d1598b27e4c2c402642 Mon Sep 17 00:00:00 2001

From: Roel Kluin <[email protected]>
Date: Tue, 2 Dec 2008 22:55:38 +0100
Subject: [PATCH] check_hung_task(): unsigned sysctl_hung_task_warnings cannot be less than 0

Impact: fix warnings-limit cutoff check for debug feature

unsigned sysctl_hung_task_warnings cannot be less than 0

---
 kernel/softlockup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/softlockup.c +1 -1
index 3953e4a..dc0b3be 100644
@@ -188,7 +188,7 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
 	if ((long)(now - t->last_switch_timestamp) <
 					sysctl_hung_task_timeout_secs)
 		return;
-	if (sysctl_hung_task_warnings < 0)
+	if (!sysctl_hung_task_warnings)
 		return;
 	sysctl_hung_task_warnings--;