git: c53fec76033a - main - sig_suspend_threads(): remove 'sending' arg
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Aug 2022 13:56:34 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c53fec76033a4282c230833c7184bfb03327e077
commit c53fec76033a4282c230833c7184bfb03327e077
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-08-03 01:04:17 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-08-03 13:56:23 +0000
sig_suspend_threads(): remove 'sending' arg
The TDA_AST flag is set on td2 unconditionally (as it was TDF_ASTPENDING
before AST rework), so it is not used practically for some time.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36033
---
sys/kern/kern_sig.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index c62b53ecc844..7780d4ce4a6c 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -110,7 +110,7 @@ static int issignal(struct thread *td);
static void reschedule_signals(struct proc *p, sigset_t block, int flags);
static int sigprop(int sig);
static void tdsigwakeup(struct thread *, int, sig_t, int);
-static int sig_suspend_threads(struct thread *, struct proc *, int);
+static int sig_suspend_threads(struct thread *, struct proc *);
static int filt_sigattach(struct knote *kn);
static void filt_sigdetach(struct knote *kn);
static int filt_signal(struct knote *kn, long hint);
@@ -2483,7 +2483,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
p->p_flag |= P_STOPPED_SIG;
p->p_xsig = sig;
PROC_SLOCK(p);
- wakeup_swapper = sig_suspend_threads(td, p, 1);
+ wakeup_swapper = sig_suspend_threads(td, p);
if (p->p_numthreads == p->p_suspcount) {
/*
* only thread sending signal to another
@@ -2650,14 +2650,13 @@ wake:
}
static int
-sig_suspend_threads(struct thread *td, struct proc *p, int sending)
+sig_suspend_threads(struct thread *td, struct proc *p)
{
struct thread *td2;
int wakeup_swapper;
PROC_LOCK_ASSERT(p, MA_OWNED);
PROC_SLOCK_ASSERT(p, MA_OWNED);
- MPASS(sending || td == curthread);
wakeup_swapper = 0;
FOREACH_THREAD_IN_PROC(p, td2) {
@@ -2682,8 +2681,6 @@ sig_suspend_threads(struct thread *td, struct proc *p, int sending)
} else if (!TD_IS_SUSPENDED(td2))
thread_suspend_one(td2);
} else if (!TD_IS_SUSPENDED(td2)) {
- if (sending || td != td2)
- ast_sched_locked(td2, TDA_AST);
#ifdef SMP
if (TD_IS_RUNNING(td2) && td2 != td)
forward_signal(td2);
@@ -2770,7 +2767,7 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si)
p->p_flag2 &= ~P2_PTRACE_FSTP;
p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE;
- sig_suspend_threads(td, p, 0);
+ sig_suspend_threads(td, p);
}
if ((td->td_dbgflags & TDB_STOPATFORK) != 0) {
td->td_dbgflags &= ~TDB_STOPATFORK;
@@ -3125,7 +3122,7 @@ sigprocess(struct thread *td, int sig)
p->p_flag |= P_STOPPED_SIG;
p->p_xsig = sig;
PROC_SLOCK(p);
- sig_suspend_threads(td, p, 0);
+ sig_suspend_threads(td, p);
thread_suspend_switch(td, p);
PROC_SUNLOCK(p);
mtx_lock(&ps->ps_mtx);