mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
sched: Move sched_autogroup_exit() to free_signal_struct()
Per Oleg's suggestion, undo fork failure free/put_signal_struct change, and move sched_autogroup_exit() to free_signal_struct() instead. Signed-off-by: Mike Galbraith <efault@gmx.de> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1294222564.8369.6.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
e9aa1dd19f
commit
1c5354de90
1 changed files with 3 additions and 4 deletions
|
@ -169,15 +169,14 @@ EXPORT_SYMBOL(free_task);
|
||||||
static inline void free_signal_struct(struct signal_struct *sig)
|
static inline void free_signal_struct(struct signal_struct *sig)
|
||||||
{
|
{
|
||||||
taskstats_tgid_free(sig);
|
taskstats_tgid_free(sig);
|
||||||
|
sched_autogroup_exit(sig);
|
||||||
kmem_cache_free(signal_cachep, sig);
|
kmem_cache_free(signal_cachep, sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void put_signal_struct(struct signal_struct *sig)
|
static inline void put_signal_struct(struct signal_struct *sig)
|
||||||
{
|
{
|
||||||
if (atomic_dec_and_test(&sig->sigcnt)) {
|
if (atomic_dec_and_test(&sig->sigcnt))
|
||||||
sched_autogroup_exit(sig);
|
|
||||||
free_signal_struct(sig);
|
free_signal_struct(sig);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __put_task_struct(struct task_struct *tsk)
|
void __put_task_struct(struct task_struct *tsk)
|
||||||
|
@ -1318,7 +1317,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
|
||||||
}
|
}
|
||||||
bad_fork_cleanup_signal:
|
bad_fork_cleanup_signal:
|
||||||
if (!(clone_flags & CLONE_THREAD))
|
if (!(clone_flags & CLONE_THREAD))
|
||||||
put_signal_struct(p->signal);
|
free_signal_struct(p->signal);
|
||||||
bad_fork_cleanup_sighand:
|
bad_fork_cleanup_sighand:
|
||||||
__cleanup_sighand(p->sighand);
|
__cleanup_sighand(p->sighand);
|
||||||
bad_fork_cleanup_fs:
|
bad_fork_cleanup_fs:
|
||||||
|
|
Loading…
Reference in a new issue