Skip to contentSkip to conversation

softlockup: minor cleanup, don't check task->state twice

PATCH In review Oleg Nesterov 2 participants 2 messages Aug 30, 2008 – Sep 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softlockup: minor cleanup, don't check task->state twice

The recent commit 16d9679f33caf7e683471647d1472bfe133d858 changed check_hung_task() to filter out the TASK_KILLABLE tasks. We can move this check to the caller which has to test t->state anyway.

kernel/softlockup.c renamed from kernel/softlockup.c~SOFTLOCKUP +2 -5
@@ -180,10 +180,6 @@ static void check_hung_task(struct task_
 	if (t->flags & PF_FROZEN)
 		return;
 
-	/* Don't check for tasks waiting on network file systems like NFS */
-	if (t->state & TASK_KILLABLE)
-		return;
-
 	if (switch_count != t->last_switch_count || !t->last_switch_timestamp) {
 		t->last_switch_count = switch_count;
 		t->last_switch_timestamp = now;
@@ -237,7 +233,8 @@ static void check_hung_uninterruptible_t
 	do_each_thread(g, t) {
 		if (!--max_count)
 			goto unlock;
-		if (t->state & TASK_UNINTERRUPTIBLE)
+		/* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */
+		if (t->state == TASK_UNINTERRUPTIBLE)
 			check_hung_task(t, now);
 	} while_each_thread(g, t);
  unlock:
#1 lore raw

Oleg Nesterov wrote:

Hi Oleg,

Quoted 3 lines

The recent commit 16d9679f33caf7e683471647d1472bfe133d858 changed check_hung_task() to filter out the TASK_KILLABLE tasks. We can move this check to the caller which has to test t->state anyway.

Yes makes sense to do it this way. Thanks.

-Andi