From nobody Sat Dec 30 06:18:57 2023 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 4T2BsG0gFYz55bbG; Sat, 30 Dec 2023 06:18:58 +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 4T2BsF6xcQz3cYt; Sat, 30 Dec 2023 06:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703917138; 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=s/O6AclWuzAPqEcIb5hViRj0B+qCwWeK5G+Fp6n1jEk=; b=LipThyKQMqNB8vEThQuTu8S+TpKZ9IkmdQwMLusPXnDwfkDiaPaMxQKTv1WUSOS/ga6lM5 BIUIDKaN6Z+PFGinI80rkY77eKlIFrOn0wZzLgOFwCCu4Cz0DmOg7er+6F3tQ7nMkxMWAB 9bI00YaA8X2Gyqc1bPDSv3fC5Gb/D6v4Z6YLdgBKG+EaRKUD39GZ7MApZLRN/kjYOEDoaH sBI53WTOLVY6iohHDcric8lAbQRa2qP7+bhVfaSjlnJvwJhSGJK/LIB7nm3EjofZ5qOcVV YOWfrd9OKsUD9T9TzaGsU6aNthezW4Bga9QiDV2Od+NiYrMworDlj6RLs3A1FA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703917138; a=rsa-sha256; cv=none; b=OcrgzPwCZg4rpKCFzT9hHFrmyM69kpaIO4Egxt8+quSeTiRqf7RC9u2pHQKJY8BsnYg+LX zcr1TLK1nsbB0fYEPWlnr6J7eSsT49mZgu4Krq+VaLDrBNUklcQv4SV14pZqdrEm7oEsk5 /SDzZiBTUwuU9sL/Pnsoc9l/nSnHtrkOeCkGmhfUmkO5VZ3AaNY6bsB1Gq01Qrjxe6shck KVtnBLu2uWYpvb11ESvwiSzQewwX2mvO/xdcXirqPPjHtJxViRtFMP/A6y8bvA+Ux8IBFs YVbOnihpssxnO8Zgrmz6Fw3D9y+vlsZT9d/eiI12Tvc78Gui6J9JMEoiDO7Rxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703917138; 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=s/O6AclWuzAPqEcIb5hViRj0B+qCwWeK5G+Fp6n1jEk=; b=HcfRjlKwQcyFYDY3H5l1QTB1QafEhwVi3WYffVhUo0F+yTF3EkcrAjGd3P/CHotZ98sF+u 9VTBV+EHNbAjhgIu17iA29RdGfxJrmAeAkMWejItHLpXpYh7q2QxkBviWb38CYfA16DqGs mHmw8mSKA4a7IEhsQeHNRc9tzhC9SokDMgnPXgxgiHKecT/hFAdZZWnKb+eDISJTQ98KNJ L31WW91xOwLsVU197nvyNbSdylWcpbzYg2e8buzdxN8LKABqPFfaIBPWN8aGRtKv+Rfeai 5E9xz3QuUAFCU8lwdNHiwyrDyI9b0yAtezYrgjllk1jxfQIkkOHVzEvDMi8D2g== 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 4T2BsF5sS8zfdB; Sat, 30 Dec 2023 06:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BU6IvYZ097468; Sat, 30 Dec 2023 06:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BU6Ivbt097465; Sat, 30 Dec 2023 06:18:57 GMT (envelope-from git) Date: Sat, 30 Dec 2023 06:18:57 GMT Message-Id: <202312300618.3BU6Ivbt097465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Jakub Dawidek Subject: git: 1b8d70b2eb71 - main - kern: Introduce kern.pid_max_limit sysctl. 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: pjd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b8d70b2eb713f5c75605419bb2505ce18fa304a Auto-Submitted: auto-generated The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=1b8d70b2eb713f5c75605419bb2505ce18fa304a commit 1b8d70b2eb713f5c75605419bb2505ce18fa304a Author: Pawel Jakub Dawidek AuthorDate: 2023-12-30 06:15:17 +0000 Commit: Pawel Jakub Dawidek CommitDate: 2023-12-30 06:15:17 +0000 kern: Introduce kern.pid_max_limit sysctl. The kern.pid_max_limit will hold the PID_MAX value the kernel was compiled with. The existing kern.pid_max sysctl can be modified and doesn't really represent maximum PID number in the system, as there may still be processes created with higher PIDs before kern.pid_max was lowered. Reivewed by: kib, zlei Approved by: oshogbo Differential Revision: https://reviews.freebsd.org/D43077 --- sys/kern/kern_mib.c | 4 ++++ sys/sys/proc.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 5a95e3454ff2..b7a801cd53c0 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -754,6 +754,10 @@ SYSCTL_PROC(_kern, OID_AUTO, pid_max, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_pid_max, "I", "Maximum allowed pid"); +SYSCTL_INT(_kern, OID_AUTO, pid_max_limit, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, PID_MAX, + "Maximum allowed pid (kern.pid_max) top limit"); + #include #include SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, diff --git a/sys/sys/proc.h b/sys/sys/proc.h index e7d2a1775603..33a878dc46aa 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -955,7 +955,7 @@ MALLOC_DECLARE(M_SUBPROC); * in a pid_t, as it is used to represent "no process group". */ #define PID_MAX 99999 -#define NO_PID 100000 +#define NO_PID (PID_MAX + 1) #define THREAD0_TID NO_PID extern pid_t pid_max;