mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 04:50:53 +07:00
exec: simplify ->sighand switching
There is no any reason to do recalc_sigpending() after changing ->sighand. To begin with, recalc_sigpending() does not take ->sighand into account. This means we don't need to take newsighand->siglock while changing sighands. rcu_assign_pointer() provides a necessary barrier, and if another process reads the new ->sighand it should either take tasklist_lock or it should use lock_task_sighand() which has a corresponding smp_read_barrier_depends(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2b47c3611d
commit
0840a90d94
@ -916,12 +916,7 @@ static int de_thread(struct task_struct *tsk)
|
||||
|
||||
write_lock_irq(&tasklist_lock);
|
||||
spin_lock(&oldsighand->siglock);
|
||||
spin_lock_nested(&newsighand->siglock, SINGLE_DEPTH_NESTING);
|
||||
|
||||
rcu_assign_pointer(tsk->sighand, newsighand);
|
||||
recalc_sigpending();
|
||||
|
||||
spin_unlock(&newsighand->siglock);
|
||||
spin_unlock(&oldsighand->siglock);
|
||||
write_unlock_irq(&tasklist_lock);
|
||||
|
||||
@ -936,7 +931,6 @@ static int de_thread(struct task_struct *tsk)
|
||||
* These functions flushes out all traces of the currently running executable
|
||||
* so that a new one can be started
|
||||
*/
|
||||
|
||||
static void flush_old_files(struct files_struct * files)
|
||||
{
|
||||
long j = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user