Skip to content

Commit

Permalink
hung_task: fix false positive during vfork
Browse files Browse the repository at this point in the history
vfork parent uninterruptibly and unkillably waits for its child to
exec/exit. This wait is of unbounded length. Ignore such waits
in the hung_task detector.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reported-by: Sasha Levin <levinsasha928@gmail.com>
LKML-Reference: <1325344394.28904.43.camel@lappy>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: John Kacur <jkacur@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mandeep Singh Baines authored and torvalds committed Jan 4, 2012
1 parent 30e0532 commit f9fab10
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)

/*
* Ensure the task is not frozen.
* Also, when a freshly created task is scheduled once, changes
* its state to TASK_UNINTERRUPTIBLE without having ever been
* switched out once, it musn't be checked.
* Also, skip vfork and any other user process that freezer should skip.
*/
if (unlikely(t->flags & PF_FROZEN || !switch_count))
if (unlikely(t->flags & (PF_FROZEN | PF_FREEZER_SKIP)))
return;

/*
* When a freshly created task is scheduled once, changes its state to
* TASK_UNINTERRUPTIBLE without having ever been switched out once, it
* musn't be checked.
*/
if (unlikely(!switch_count))
return;

if (switch_count != t->last_switch_count) {
Expand Down

0 comments on commit f9fab10

Please sign in to comment.