diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-12-10 18:54:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:17 -0500 |
commit | 986094dfe161b4346831547136d4e5ed7f94310e (patch) | |
tree | 41b5dfa7e1d4b894b300f3386d951d195b0a317f /kernel/exit.c | |
parent | f953ccd00615140b5e722ffe2b920da22dfb4db9 (diff) |
exit: wait: drop tasklist_lock before psig->c* accounting
wait_task_zombie() no longer needs tasklist_lock to accumulate the
psig->c* counters, we can drop it right after cmpxchg(exit_state).
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Aaron Tomlin <atomlin@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sterling Alexander <stalexan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 457673d65934..6297eb0f5bd2 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1005,6 +1005,11 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1005 | EXIT_TRACE : EXIT_DEAD; | 1005 | EXIT_TRACE : EXIT_DEAD; |
1006 | if (cmpxchg(&p->exit_state, EXIT_ZOMBIE, state) != EXIT_ZOMBIE) | 1006 | if (cmpxchg(&p->exit_state, EXIT_ZOMBIE, state) != EXIT_ZOMBIE) |
1007 | return 0; | 1007 | return 0; |
1008 | /* | ||
1009 | * We own this thread, nobody else can reap it. | ||
1010 | */ | ||
1011 | read_unlock(&tasklist_lock); | ||
1012 | sched_annotate_sleep(); | ||
1008 | 1013 | ||
1009 | /* | 1014 | /* |
1010 | * Check thread_group_leader() to exclude the traced sub-threads. | 1015 | * Check thread_group_leader() to exclude the traced sub-threads. |
@@ -1064,13 +1069,6 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1064 | spin_unlock_irq(¤t->sighand->siglock); | 1069 | spin_unlock_irq(¤t->sighand->siglock); |
1065 | } | 1070 | } |
1066 | 1071 | ||
1067 | /* | ||
1068 | * Now we are sure this task is interesting, and no other | ||
1069 | * thread can reap it because we its state == DEAD/TRACE. | ||
1070 | */ | ||
1071 | read_unlock(&tasklist_lock); | ||
1072 | sched_annotate_sleep(); | ||
1073 | |||
1074 | retval = wo->wo_rusage | 1072 | retval = wo->wo_rusage |
1075 | ? getrusage(p, RUSAGE_BOTH, wo->wo_rusage) : 0; | 1073 | ? getrusage(p, RUSAGE_BOTH, wo->wo_rusage) : 0; |
1076 | status = (p->signal->flags & SIGNAL_GROUP_EXIT) | 1074 | status = (p->signal->flags & SIGNAL_GROUP_EXIT) |