From nobody Sun Oct 10 09:24:20 2021 X-Original-To: dev-commits-src-branches@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 13D2A12DF55B; Sun, 10 Oct 2021 09:24:26 +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 4HRxMX6HnNz3N7c; Sun, 10 Oct 2021 09:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8482B3217; Sun, 10 Oct 2021 09:24:20 +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 19A9OK5u003563; Sun, 10 Oct 2021 09:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19A9OK1H003562; Sun, 10 Oct 2021 09:24:20 GMT (envelope-from git) Date: Sun, 10 Oct 2021 09:24:20 GMT Message-Id: <202110100924.19A9OK1H003562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c2c6108a1fe5 - stable/13 - Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c2c6108a1fe546d16d3444d9ef44e4f55f3206fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c2c6108a1fe546d16d3444d9ef44e4f55f3206fc commit c2c6108a1fe546d16d3444d9ef44e4f55f3206fc Author: Konstantin Belousov AuthorDate: 2021-10-03 01:52:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-10 09:21:18 +0000 Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT (cherry picked from commit b599982b65e36523a8aa828a9d504135144158db) --- sys/kern/kern_sig.c | 17 +++++++++++------ sys/sys/proc.h | 3 +-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d61812ad3043..059c1716a89b 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1297,8 +1297,11 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, saved_mask = td->td_sigmask; SIGSETNAND(td->td_sigmask, waitset); if ((p->p_sysent->sv_flags & SV_SIG_DISCIGN) != 0 || - !kern_sig_discard_ign) - td->td_pflags2 |= TDP2_SIGWAIT; + !kern_sig_discard_ign) { + thread_lock(td); + td->td_flags |= TDF_SIGWAIT; + thread_unlock(td); + } for (;;) { mtx_lock(&ps->ps_mtx); sig = cursig(td); @@ -1362,7 +1365,9 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) traced = true; } - td->td_pflags2 &= ~TDP2_SIGWAIT; + thread_lock(td); + td->td_flags &= ~TDF_SIGWAIT; + thread_unlock(td); new_block = saved_mask; SIGSETNAND(new_block, td->td_sigmask); @@ -2970,7 +2975,7 @@ issignal(struct thread *td) */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (p->p_flag & P_TRACED) == 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { sigqueue_delete(&td->td_sigqueue, sig); sigqueue_delete(&p->p_sigqueue, sig); continue; @@ -3083,7 +3088,7 @@ issignal(struct thread *td) mtx_lock(&ps->ps_mtx); goto next; } else if ((prop & SIGPROP_IGNORE) != 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { /* * Default action is to ignore; drop it if * not in kern_sigtimedwait(). @@ -3094,7 +3099,7 @@ issignal(struct thread *td) /*NOTREACHED*/ case (intptr_t)SIG_IGN: - if ((td->td_pflags2 & TDP2_SIGWAIT) == 0) + if ((td->td_flags & TDF_SIGWAIT) == 0) break; /* == ignore */ else return (sig); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index ffb723576e2e..cd07c8bbb122 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -444,7 +444,7 @@ do { \ #define TDF_TIMEOUT 0x00000010 /* Timing out during sleep. */ #define TDF_IDLETD 0x00000020 /* This is a per-CPU idle thread. */ #define TDF_CANSWAP 0x00000040 /* Thread can be swapped. */ -#define TDF_UNUSED80 0x00000080 /* unused. */ +#define TDF_SIGWAIT 0x00000080 /* Ignore ignored signals */ #define TDF_KTH_SUSP 0x00000100 /* kthread is suspended */ #define TDF_ALLPROCSUSP 0x00000200 /* suspended by SINGLE_ALLPROC */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ @@ -529,7 +529,6 @@ do { \ #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ #define TDP2_ACCT 0x00000004 /* Doing accounting */ -#define TDP2_SIGWAIT 0x00000008 /* Ignore ignored signals */ /* * Reasons that the current thread can not be run yet.