diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-12-01 17:18:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-12 11:01:03 -0500 |
commit | 8187926bdae98648db24db3391c4efd21ec669b1 (patch) | |
tree | e3f35eee71cdaefcf6af15471a7aee3444e658d4 | |
parent | 899921025b406a71a8aeb2d7855658ea0cf0ed23 (diff) |
posix-timers: simplify de_thread()->exit_itimers() path
Impact: simplify code
de_thread() postpones release_task(leader) until after exit_itimers().
This was needed because !SIGEV_THREAD_ID timers could use ->group_leader
without get_task_struct(). With the recent changes we can release the
leader earlier and simplify the code.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | fs/exec.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -772,7 +772,6 @@ static int de_thread(struct task_struct *tsk) | |||
772 | struct signal_struct *sig = tsk->signal; | 772 | struct signal_struct *sig = tsk->signal; |
773 | struct sighand_struct *oldsighand = tsk->sighand; | 773 | struct sighand_struct *oldsighand = tsk->sighand; |
774 | spinlock_t *lock = &oldsighand->siglock; | 774 | spinlock_t *lock = &oldsighand->siglock; |
775 | struct task_struct *leader = NULL; | ||
776 | int count; | 775 | int count; |
777 | 776 | ||
778 | if (thread_group_empty(tsk)) | 777 | if (thread_group_empty(tsk)) |
@@ -810,7 +809,7 @@ static int de_thread(struct task_struct *tsk) | |||
810 | * and to assume its PID: | 809 | * and to assume its PID: |
811 | */ | 810 | */ |
812 | if (!thread_group_leader(tsk)) { | 811 | if (!thread_group_leader(tsk)) { |
813 | leader = tsk->group_leader; | 812 | struct task_struct *leader = tsk->group_leader; |
814 | 813 | ||
815 | sig->notify_count = -1; /* for exit_notify() */ | 814 | sig->notify_count = -1; /* for exit_notify() */ |
816 | for (;;) { | 815 | for (;;) { |
@@ -862,8 +861,9 @@ static int de_thread(struct task_struct *tsk) | |||
862 | 861 | ||
863 | BUG_ON(leader->exit_state != EXIT_ZOMBIE); | 862 | BUG_ON(leader->exit_state != EXIT_ZOMBIE); |
864 | leader->exit_state = EXIT_DEAD; | 863 | leader->exit_state = EXIT_DEAD; |
865 | |||
866 | write_unlock_irq(&tasklist_lock); | 864 | write_unlock_irq(&tasklist_lock); |
865 | |||
866 | release_task(leader); | ||
867 | } | 867 | } |
868 | 868 | ||
869 | sig->group_exit_task = NULL; | 869 | sig->group_exit_task = NULL; |
@@ -872,8 +872,6 @@ static int de_thread(struct task_struct *tsk) | |||
872 | no_thread_group: | 872 | no_thread_group: |
873 | exit_itimers(sig); | 873 | exit_itimers(sig); |
874 | flush_itimer_signals(); | 874 | flush_itimer_signals(); |
875 | if (leader) | ||
876 | release_task(leader); | ||
877 | 875 | ||
878 | if (atomic_read(&oldsighand->count) != 1) { | 876 | if (atomic_read(&oldsighand->count) != 1) { |
879 | struct sighand_struct *newsighand; | 877 | struct sighand_struct *newsighand; |