Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288239
b: refs/heads/master
c: 6027ce4
h: refs/heads/master
i:
  288237: f6a61d4
  288235: 2b27751
  288231: cc3b478
  288223: e24970b
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 5, 2012
1 parent c82e8ec commit 5c02ce5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e27f63edbd7ab893258e16500171dd1270a1369
refs/heads/master: 6027ce497d44dd8eae1a9215789df178f6b422cc
11 changes: 7 additions & 4 deletions trunk/kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,20 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
* For preemptible RCU it is sufficient to call rcu_read_unlock in order
* to exit the grace period. For classic RCU, a reschedule is required.
*/
static void rcu_lock_break(struct task_struct *g, struct task_struct *t)
static bool rcu_lock_break(struct task_struct *g, struct task_struct *t)
{
bool can_cont;

get_task_struct(g);
get_task_struct(t);
rcu_read_unlock();
cond_resched();
rcu_read_lock();
can_cont = pid_alive(g) && pid_alive(t);
put_task_struct(t);
put_task_struct(g);

return can_cont;
}

/*
Expand All @@ -154,9 +159,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
goto unlock;
if (!--batch_count) {
batch_count = HUNG_TASK_BATCHING;
rcu_lock_break(g, t);
/* Exit if t or g was unhashed during refresh. */
if (t->state == TASK_DEAD || g->state == TASK_DEAD)
if (!rcu_lock_break(g, t))
goto unlock;
}
/* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */
Expand Down

0 comments on commit 5c02ce5

Please sign in to comment.