From nobody Wed Aug 03 13:56:34 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LyYLV6cbLz4Xhdw; Wed, 3 Aug 2022 13:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LyYLV633xz3fFf; Wed, 3 Aug 2022 13:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659534994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNHjkFMMhbsHPoYefECvI2PZ9VKNyM+yQo/v6Ou5j+g=; b=XkCzfGI0Zu6ZAqbvRp+ZqzewC8dsWaG2gwAkKkto1D2AkeHITRfko4go4Dm0MbO8urWb6D dJfad7QHCrqx0WksRYDG6Q5DRGYyddxa5jp25x1El8zrVS/1PFxpsYPEBNmDNORD8M8OgA /HoYbkrE4s6DcKdHwgVIY+MD8KElkWGDKn3CZZ6i8CK6kCzUKPjGNVlDnufzsU9wHRvEP0 M70AuuwheG6BT7a/84z3SB1KY6EIaDSw77g5ETaeWXynaAjuVopDFUhzLBqF9Onqolduqr 0N2ZX5X5VjNwP+kjVGmqBAkVmwmZFz1rQL53nwKKNfrbTt9XiQvOyqBk9P2mfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LyYLV4m9ZztGp; Wed, 3 Aug 2022 13:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 273DuYA8000151; Wed, 3 Aug 2022 13:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 273DuYCV000150; Wed, 3 Aug 2022 13:56:34 GMT (envelope-from git) Date: Wed, 3 Aug 2022 13:56:34 GMT Message-Id: <202208031356.273DuYCV000150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c53fec76033a - main - sig_suspend_threads(): remove 'sending' arg List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c53fec76033a4282c230833c7184bfb03327e077 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659534994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNHjkFMMhbsHPoYefECvI2PZ9VKNyM+yQo/v6Ou5j+g=; b=Z+PVuuRf0zlKTIujGtJKx6Tl4BxKPs2VEKhsQrtgtLzL4sDi3U9mC2qqFv4xs+gkxG23nR Mw439jFHjr+JcDUzYuVz2RefmO4drXWUaBWUBvkBPP3z/TIWX3S5NIN3ADaoVEOKHJeuBE OfXAxVND+Np2Pmialwn4mymgOP5i37e49/RncKVqfZXkYna7HXMuMJO/mnHM67EwDpHsq/ R9UZRUsqJrfcBvObyaR3vQtdMP+Ej0oUUitgvtmiDZCTC58eWl4TLl/gzij75cIomrGsZR cNHLjqbJCMlkJrAsTwoYv8PUtE3CJpH+Oq7P0Hnn1IIqbsrbf45OFtKDhjwxzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659534994; a=rsa-sha256; cv=none; b=qgBm3eK91MV6aPcaELMniaHn7l8X34Eqg2043mGtHVFlaI8SxuOpxk0NQ72bBIbdVi4b0r mdTRVRa25r1wzqahPipkj7XEmgYxzJEY+dQWrcieccOioL/lmzr80n1pqw+igP3bt4fMbk PNhSWWR72bQ7zURR+YD8Lge60EzYbqfO8dGWo1NP1GhgZ5mBUO7LkfpJvS83tnLxmr6yBF 8ICF86WPfZMaCmCmSOtt4NnoSpdzdbHBuH+BMTwkPc3jhtj/TlKfEOEiJ6S0g6Vcd0LwH7 2LBWnGDtXr8XPe5/7U5ZWI+JIDryL0SQGoChBsc4UnYYYcS57Klc6BJHIrhJ6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c53fec76033a4282c230833c7184bfb03327e077 commit c53fec76033a4282c230833c7184bfb03327e077 Author: Konstantin Belousov AuthorDate: 2022-08-03 01:04:17 +0000 Commit: Konstantin Belousov 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);