From nobody Sat Sep 3 01:29:25 2022 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 4MKHJ532TFz4bwBM; Sat, 3 Sep 2022 01:29:25 +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 4MKHJ52Mgmz3NKx; Sat, 3 Sep 2022 01:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662168565; 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=WjSv6SDIo7EckWXJLYe4au6vCDs7H6DeAdbZeIi1azA=; b=LW1gnT2SwyzSvNzKQsv4jG1yt849yP/sgwj23HGNK6CuNq5gnDpdh1Kg+/Y4+4VLB5K8dQ yEli/lMtaPO1nX6nKzCyg/lDpEK64pg6Lz8M0NX7/LaZXdBWTUi4QU35SOq5yeikHXev6s rvhMJ4RxD0zwVm5jWHvlrdH8HFpmzJxoBhY0yQ3SS4rhpxOUFMhNpSem2WES80WyprVlIK BE5X0HvzHapuS84fZz+TiRL6Gz4gLX5QXGIxI0zfyuSKOW9/xvn5WWKDhIgyKRZrBkN8NI 4VqLZ9AvVoAlwQi9tlxyuJB6mQ+PK+hWvD32wFxgJ3BZ9tRv6eGJJYjDq+pDyg== 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 4MKHJ51P85z10PG; Sat, 3 Sep 2022 01:29:25 +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 2831TPuh002671; Sat, 3 Sep 2022 01:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2831TPpO002670; Sat, 3 Sep 2022 01:29:25 GMT (envelope-from git) Date: Sat, 3 Sep 2022 01:29:25 GMT Message-Id: <202209030129.2831TPpO002670@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: 853c4ef74843 - stable/13 - Remove struct proc p_singlethr member 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: 853c4ef748430f5a5e7e35a672180ad70be426cf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662168565; 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=WjSv6SDIo7EckWXJLYe4au6vCDs7H6DeAdbZeIi1azA=; b=iEQS3fVooj8JUei7UV9HrvOu+ChhxbnoWseOMSOYoF6gtZSqiFrAxVWVJHjZ7HsKDOgzEc 7/vPyqqVkPAJwKtVlOXddMO/pNSxbXpbkrhAU+IzXiNj6LsJNhVN3tgrkPIzN3fnouBOMq yasVSeUUb1nIptIfQtuhAXXYRvMRK7vlCEF7x5TwR2Dq3E2rb27KhpvvNJHSPgt/+H1Zu0 4dKYwuAIXjMhgXKcfAR5QkhNr/Mq3QVkEAAv6ucQrYykPLllQ4oSJQEszfoeGm/GBN94FH RDq5wb2GhN8LUgimRFcJJDEI9Xn4fuhw59QacuIUkRFFVvSnJ4qc8jXOL6iwYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662168565; a=rsa-sha256; cv=none; b=xrukqt7fVqAPytfLL4oEQZcew8F+pmEoQ2/WC6Gp2YgHFnsVWHf0frQEKiaVKBy4S3Zn7M YUEiHs3P6aZk3fpPB2orSw2CXNd7Gq5I5r7p52cnyEhIHnqbhNINilDuliUsBoTJY7Mszg iXqriu4L8HKkTNJeIMyB3O9HnENJzuF3d3AXRyrbGCgjt0sPkI7B1r9wDOYFo9Y2kt2lf6 7j3wnj6WfKLph3QyfemTB3WACyB3NtAqgGa9WVwIZRV2Zo2aJhOZlqhfAewXh5XRu5yyGl h69z/kNEp7OpG3O0SqdtCvP5gsPCMVB/746UCsoEW9gXVrKlmJUHoW6p4kJOWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=853c4ef748430f5a5e7e35a672180ad70be426cf commit 853c4ef748430f5a5e7e35a672180ad70be426cf Author: Konstantin Belousov AuthorDate: 2022-08-12 19:59:56 +0000 Commit: Konstantin Belousov CommitDate: 2022-09-03 01:17:36 +0000 Remove struct proc p_singlethr member (cherry picked from commit 5e5675cb4bfa80b6026b5c781d6fa2cc9254468f) --- sys/kern/kern_exec.c | 9 --------- sys/kern/kern_exit.c | 2 -- sys/kern/kern_fork.c | 9 --------- sys/kern/kern_procctl.c | 6 ------ sys/sys/proc.h | 2 -- 5 files changed, 28 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1848bf5234bb..d8e1779825c6 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 ca32f318c0cf..aca2ca81f057 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 862e61bad207..d6d90dd9534c 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -318,17 +318,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); @@ -393,7 +385,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * bzero(&p2->p_startzero, __rangeof(struct proc, p_startzero, p_endzero)); - p2->p_singlethr = 0; /* Tell the prison that we exist. */ prison_proc_hold(p2->p_ucred->cr_prison); 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/sys/proc.h b/sys/sys/proc.h index 686a9aacdfdd..50e99d5a94c8 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -727,8 +727,6 @@ struct proc { char *p_binname; /* (b) Binary hardlink name. */ void *p_elf_brandinfo; /* (x) Elf_Brandinfo, NULL for non ELF binaries. */ - int p_singlethr; /* (c) Count of threads doing - external thread_single() */ }; #define p_session p_pgrp->pg_session