Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40409
b: refs/heads/master
c: fca178c
h: refs/heads/master
i:
  40407: 898ba72
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 28, 2006
1 parent 36005e5 commit ebcc921
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: 6e6d9fa6f95e382bb2d5725dda18b9e811418e79
refs/heads/master: fca178c0c6e8d52a1875be36b070f30884ebfae9
15 changes: 9 additions & 6 deletions trunk/kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,17 @@ static int fill_tgid(pid_t tgid, struct task_struct *tgidtsk,
} else
get_task_struct(first);

/* Start with stats from dead tasks */
spin_lock_irqsave(&first->signal->stats_lock, flags);
if (first->signal->stats)
memcpy(stats, first->signal->stats, sizeof(*stats));
spin_unlock_irqrestore(&first->signal->stats_lock, flags);

tsk = first;
read_lock(&tasklist_lock);
/* Start with stats from dead tasks */
if (first->signal) {
spin_lock_irqsave(&first->signal->stats_lock, flags);
if (first->signal->stats)
memcpy(stats, first->signal->stats, sizeof(*stats));
spin_unlock_irqrestore(&first->signal->stats_lock, flags);
}

do {
if (tsk->exit_state == EXIT_ZOMBIE && thread_group_leader(tsk))
continue;
Expand All @@ -264,7 +267,7 @@ static int fill_tgid(pid_t tgid, struct task_struct *tgidtsk,
* Accounting subsytems can also add calls here to modify
* fields of taskstats.
*/

put_task_struct(first);
return 0;
}

Expand Down

0 comments on commit ebcc921

Please sign in to comment.