From nobody Sat Aug 20 17:35:02 2022 X-Original-To: dev-commits-src-all@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 4M95Nk4K8Nz4ZpbP; Sat, 20 Aug 2022 17:35:02 +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 4M95Nk3QCFz3Y2T; Sat, 20 Aug 2022 17:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661016902; 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=ytvqUGCqzAGalWLW7ubSN+1l0v9NzeLqTMM8tF79TBo=; b=BFSJe658Y6eDKwokBXFh5maaF+WGwOvd9HgMiVEu433/AHzX2MCB9xgwq/9ECaEN3Thn1n tCmMQCQXHppxY7ETZeOIQqmUdvZr288gs29YwqDPw/c6h6oVsxiwkQpowcGXUBUyQLspbl b/S/gK9+LZEhybsLTtw1LioHQ2PjnBRhg8GYfMiReOVzR/EHsgBPoc+DD3Fn1u6FfWs0MD BqHLu+CUf8w1chaCbe9OWGb7nfnmtJmdanSzIaep5tDwRrBuYAwwOW1+Yti6HQBz1XTN+Y J6tWHxNVljx+S+LsLa0jh1+rAuoYot+A4/UQQVBjKvuMbqUhirMqVbmu1Ncttg== 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 4M95Nk2TMLzgYl; Sat, 20 Aug 2022 17:35:02 +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 27KHZ2tc093559; Sat, 20 Aug 2022 17:35:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27KHZ2ih093558; Sat, 20 Aug 2022 17:35:02 GMT (envelope-from git) Date: Sat, 20 Aug 2022 17:35:02 GMT Message-Id: <202208201735.27KHZ2ih093558@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: 5e5675cb4bfa - main - Remove struct proc p_singlethr member List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 5e5675cb4bfa80b6026b5c781d6fa2cc9254468f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661016902; 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=ytvqUGCqzAGalWLW7ubSN+1l0v9NzeLqTMM8tF79TBo=; b=s7x8rjbC86jbdbY0iQJD5N3YaCwoJd/DfyGuqjXyMFRcr9+/+/7oyp+zkDTZSn3M1fBPSL 3MF2RjCkwqDMDwOUNsbgQg5nK4casu/DVezsGzOjAa5VR3niICj6SjEGqMpxeEX4tcUyba Co2yZRL6R/BHm1muiPfCML+Zsrc3GyEitWVEFjFg+FUk/XdpNrkU8EaUrXj5lnjDxyelIS RviPPHEtVXkKFec/X65L9CpjD5f9ssUnxEBcDLkT+GdnskNMGrNm12JHeUag+DNyg/jt9T p5j41qhrd3Yjt2AC+stOvydbvXkWqYDWw5RNwpVC6hipFqluO9j6lQhFfb0ffw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661016902; a=rsa-sha256; cv=none; b=grA/EhDkeHUtqu5eOP7KiH8RUdAuWLVxB+nmu6Ik4ZJp7CmI+4FM9pZTyxlW1fQH7IkpH1 nAW1WibdtIcwBwurmba1W/JVIRvKmDXTsVU6l6Fd9QLvKTZNctfhv2cYJs2EHG9gY+KOSB xdkGtT42PEuUBQb8swwtlq8dkm+IlO6be43Br1rNCY12jvEb0a9HXPR9y6FmSAPbVQm6gU lfXxHC43sw6oJ6DyTQaasNXTNvzfb/21SyjH905OKY8yw9zvjM66+TvmSMmmsjn7hs+gTX yHVLeYAB+/tPp66VY8FSfjFx8GuF2P/pOopct412TM5WtvQ9LPOZ1wzLJ6gMMA== 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=5e5675cb4bfa80b6026b5c781d6fa2cc9254468f commit 5e5675cb4bfa80b6026b5c781d6fa2cc9254468f Author: Konstantin Belousov AuthorDate: 2022-08-12 19:59:56 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-20 17:34:30 +0000 Remove struct proc p_singlethr member It does not serve any purpose after we stopped doing thread_single(SINGLE_ALLPROC) from stoppable user processes. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36207 --- sys/kern/kern_exec.c | 9 --------- sys/kern/kern_exit.c | 2 -- sys/kern/kern_fork.c | 8 -------- sys/kern/kern_procctl.c | 6 ------ sys/kern/kern_thread.c | 6 +++--- sys/sys/proc.h | 2 -- 6 files changed, 3 insertions(+), 30 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 0ead8d81fe59..364c10987ea6 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -307,17 +307,8 @@ pre_execve(struct thread *td, struct vmspace **oldvmspace) p = td->td_proc; if ((p->p_flag & P_HADTHREADS) != 0) { PROC_LOCK(p); - while (p->p_singlethr > 0) { - error = msleep(&p->p_singlethr, &p->p_mtx, - PWAIT | PCATCH, "exec1t", 0); - if (error != 0) { - error = ERESTART; - goto unlock; - } - } if (thread_single(p, SINGLE_BOUNDARY) != 0) error = ERESTART; -unlock: PROC_UNLOCK(p); } KASSERT(error != 0 || (td->td_pflags & TDP_EXECVMSPC) == 0, diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 4c3821ddfa72..cb51193a26e0 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -218,8 +218,6 @@ proc_set_p2_wexit(struct proc *p) { PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag2 |= P2_WEXIT; - while (p->p_singlethr > 0) - msleep(&p->p_singlethr, &p->p_mtx, PWAIT | PCATCH, "exit1t", 0); } /* diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index c71a0422b1e2..b4f96686caba 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -319,17 +319,9 @@ fork_norfproc(struct thread *td, int flags) * must ensure that other threads do not concurrently create a second * process sharing the vmspace, see vmspace_unshare(). */ -again: if ((p1->p_flag & (P_HADTHREADS | P_SYSTEM)) == P_HADTHREADS && ((flags & (RFCFDG | RFFDG)) != 0 || (flags & RFMEM) == 0)) { PROC_LOCK(p1); - if (p1->p_singlethr > 0) { - error = msleep(&p1->p_singlethr, &p1->p_mtx, - PWAIT | PCATCH | PDROP, "rfork1t", 0); - if (error != 0) - return (ERESTART); - goto again; - } if (thread_single(p1, SINGLE_BOUNDARY)) { PROC_UNLOCK(p1); return (ERESTART); diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 1fb1183741d6..9d48b04dde48 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -477,15 +477,9 @@ reap_kill_subtree(struct thread *td, struct proc *p, struct proc *reaper, PROC_UNLOCK(td->td_proc); goto out; } - td->td_proc->p_singlethr++; PROC_UNLOCK(td->td_proc); while (reap_kill_subtree_once(td, p, reaper, &pids, w)) ; - PROC_LOCK(td->td_proc); - td->td_proc->p_singlethr--; - if (td->td_proc->p_singlethr == 0) - wakeup(&p->p_singlethr); - PROC_UNLOCK(td->td_proc); out: clean_unrhdr(&pids); clear_unrhdr(&pids); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index a15488b29cb6..bfd153844464 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -99,7 +99,7 @@ _Static_assert(offsetof(struct proc, p_pid) == 0xc4, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x3c8, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e4, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e0, "struct proc KBI p_comm"); _Static_assert(offsetof(struct proc, p_emuldata) == 0x4c8, "struct proc KBI p_emuldata"); @@ -119,9 +119,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0x78, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x270, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x288, +_Static_assert(offsetof(struct proc, p_comm) == 0x284, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x314, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x310, "struct proc KBI p_emuldata"); #endif diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 9d55f0b71e4f..8c2aa6391d69 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -720,8 +720,6 @@ struct proc { int p_pendingexits; /* (c) Count of pending thread exits. */ struct filemon *p_filemon; /* (c) filemon-specific data. */ int p_pdeathsig; /* (c) Signal from parent on exit. */ - int p_singlethr; /* (c) Count of threads doing - external thread_single() */ /* End area that is zeroed on creation. */ #define p_endzero p_magic