From nobody Mon Jul 29 01:50:03 2024 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 4WXLs81pMLz5S7Ln; Mon, 29 Jul 2024 01:50:04 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXLs80Y25z4npb; Mon, 29 Jul 2024 01:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722217804; 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=AoZPn7AYergNW8AqA4pyvip6CBLCXarT3KvS/IiiDSQ=; b=L0QHzwcojDPC1wUw5Xw/fwk1jahyYDXQEhaNJq8a0RawRsLjOzGb4577n3IAZU4z7WHO7X wFaR7fjh5kTBZDwbZWGsVhD/sKGknpBEa743TorEjDpLwKtGubNCAt7vntfqb+QDJ76vkm A6SFy6vgEHPoRuJM/ZD9rL+mSd2wFgk6urlki7nVKjh4ukKxn9yBv2wRpLGDGeXbmJWuC3 Oirf8gHMXifJAZXcxiRqMbgkKxK1sCAu6ljeqOi5bVO//AdXveLlOgqLg1EvQFCuALAag9 y1Dty617gQ4EZzPGsfnP1drEmOqSx/I+Ky3/7ePY51wYCqtzmWj/s06i2lFvUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722217804; a=rsa-sha256; cv=none; b=Ix3jSI4MvZZ3nJ0vS+qJRADojgItvNtA6PsWjSKj23VdPzw3RviG8tzpuuKa8sxEB/3GPR 56/R3Aa5rkcl3BT8/NGXyli46gz0sSW9wUgE5Z/TZMPUT7dPtjfX+z9KCdD01F+hWXvI0g brcIVGRdKkVFq9ZVt0IFXYkgAbyiAu/TgWI5yUcQnDp5I6WlP+xQzNU+IB9FvCDktcwUUb VL7UIY5Z1OpF5h5eVVHCKXc/HOzEkW5jsTgZV92Lp18LrJa5wsDP8Qo1ekr9QxHjw+4Hqw pTlgEaiSyxHpfNTPf+ILvPXBx2Pz0bRQjVszt43sQYVAtJyvIUBjJwd9U/zj2g== 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=1722217804; 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=AoZPn7AYergNW8AqA4pyvip6CBLCXarT3KvS/IiiDSQ=; b=Iu1B+k2zvAee9cqj8CYLyrQPsMm2g2mf1qFy2E9So7G3uTsxxaU2ZylC5LhNTXFkptpE8E zjYM8e3s39xH09JO7UoMEBG1jqb3+2HW5qczmJER0oAlWEop1uWuvbprIotyn7m2rZXjFw GfYf5ke0lTD3YvUuzs2a5lQrJO5MkIUoHhxex2ekvcDfqK8kmNcIzH8W/2W74gGVMfQhuS gNJgP0Z4nc+TWF/K+/WIJKJbSeI8vAGX/AA9/dnsxsYe3rPbw4I17YBtONw9cDhgISjdOq 0snpf6J64aPGAFMVJgnsrK9aquZgXqWlyXQ/VMuJvupRB6i5NchCxoqZaaDj/w== 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 4WXLs76p55zF1J; Mon, 29 Jul 2024 01:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46T1o3n5094595; Mon, 29 Jul 2024 01:50:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46T1o3KF094589; Mon, 29 Jul 2024 01:50:03 GMT (envelope-from git) Date: Mon, 29 Jul 2024 01:50:03 GMT Message-Id: <202407290150.46T1o3KF094589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ec84a986baf1 - main - vm: Remove kernel stack swapping support, part 11 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec84a986baf18c9c2c5799ac8f77a57ec85652b9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ec84a986baf18c9c2c5799ac8f77a57ec85652b9 commit ec84a986baf18c9c2c5799ac8f77a57ec85652b9 Author: Mark Johnston AuthorDate: 2024-07-29 01:42:40 +0000 Commit: Mark Johnston CommitDate: 2024-07-29 01:43:59 +0000 vm: Remove kernel stack swapping support, part 11 - Remove sysctls that control stack swapping, update documentation. - Remove vm_swapout_dummy.c, which serves no purpose now. Tested by: pho Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46129 --- lib/libsys/getrlimit.2 | 8 +---- share/man/man7/tuning.7 | 25 +------------ sys/conf/files | 1 - sys/vm/vm_swapout.c | 27 -------------- sys/vm/vm_swapout_dummy.c | 92 ----------------------------------------------- 5 files changed, 2 insertions(+), 151 deletions(-) diff --git a/lib/libsys/getrlimit.2 b/lib/libsys/getrlimit.2 index 00f25cff85cd..670da91a4484 100644 --- a/lib/libsys/getrlimit.2 +++ b/lib/libsys/getrlimit.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 30, 2016 +.Dd July 25, 2024 .Dt GETRLIMIT 2 .Os .Sh NAME @@ -88,12 +88,6 @@ The maximum number of pseudo-terminals this user id is allowed to create. When there is memory pressure and swap is available, prioritize eviction of a process' resident pages beyond this amount (in bytes). When memory is not under pressure, this rlimit is effectively ignored. -Even when there is memory pressure, the amount of available swap space and some -sysctl settings like -.Xr vm.swap_enabled -and -.Xr vm.swap_idle_enabled -can affect what happens to processes that have exceeded this size. .Pp Processes that exceed their set .Dv RLIMIT_RSS diff --git a/share/man/man7/tuning.7 b/share/man/man7/tuning.7 index caa1efb7d450..8cebfe62bb64 100644 --- a/share/man/man7/tuning.7 +++ b/share/man/man7/tuning.7 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 17, 2023 +.Dd July 25, 2024 .Dt TUNING 7 .Os .Sh NAME @@ -504,29 +504,6 @@ The read-only .Va kern.openfiles sysctl may be interrogated to determine the current number of open files on the system. -.Pp -The -.Va vm.swap_idle_enabled -sysctl is useful in large multi-user systems where you have lots of users -entering and leaving the system and lots of idle processes. -Such systems -tend to generate a great deal of continuous pressure on free memory reserves. -Turning this feature on and adjusting the swapout hysteresis (in idle -seconds) via -.Va vm.swap_idle_threshold1 -and -.Va vm.swap_idle_threshold2 -allows you to depress the priority of pages associated with idle processes -more quickly then the normal pageout algorithm. -This gives a helping hand -to the pageout daemon. -Do not turn this option on unless you need it, -because the tradeoff you are making is to essentially pre-page memory sooner -rather than later, eating more swap and disk bandwidth. -In a small system -this option will have a detrimental effect but in a large system that is -already doing moderate paging this option allows the VM system to stage -whole processes into and out of memory more easily. .Sh LOADER TUNABLES Some aspects of the system behavior may not be tunable at runtime because memory allocations they perform must occur early in the boot process. diff --git a/sys/conf/files b/sys/conf/files index 1f99c3586b86..08b8dbed43b0 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -5267,7 +5267,6 @@ vm/vm_phys.c standard vm/vm_radix.c standard vm/vm_reserv.c standard vm/vm_swapout.c optional !NO_SWAPPING -vm/vm_swapout_dummy.c optional NO_SWAPPING vm/vm_unix.c standard vm/vnode_pager.c standard xen/features.c optional xenhvm diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c index cb5dab7cacdd..016cdf2a2cc8 100644 --- a/sys/vm/vm_swapout.c +++ b/sys/vm/vm_swapout.c @@ -122,33 +122,6 @@ static struct kproc_desc vm_kp = { }; SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); -static int vm_swap_enabled = 1; -static int vm_swap_idle_enabled = 0; - -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, CTLFLAG_RW, - &vm_swap_enabled, 0, - "Enable entire process swapout"); -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, CTLFLAG_RW, - &vm_swap_idle_enabled, 0, - "Allow swapout on idle criteria"); - -/* - * Swap_idle_threshold1 is the guaranteed swapped in time for a process - */ -static int swap_idle_threshold1 = 2; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold1, CTLFLAG_RW, - &swap_idle_threshold1, 0, - "Guaranteed swapped in time for a process"); - -/* - * Swap_idle_threshold2 is the time that a process can be idle before - * it will be swapped out, if idle swapping is enabled. - */ -static int swap_idle_threshold2 = 10; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2, CTLFLAG_RW, - &swap_idle_threshold2, 0, - "Time before a process will be swapped out"); - static int vm_daemon_timeout = 0; SYSCTL_INT(_vm, OID_AUTO, vmdaemon_timeout, CTLFLAG_RW, &vm_daemon_timeout, 0, diff --git a/sys/vm/vm_swapout_dummy.c b/sys/vm/vm_swapout_dummy.c deleted file mode 100644 index 6fe15ad44f11..000000000000 --- a/sys/vm/vm_swapout_dummy.c +++ /dev/null @@ -1,92 +0,0 @@ -/*- - * SPDX-License-Identifier: (BSD-4-Clause AND MIT-CMU) - * - * Copyright (c) 1991 Regents of the University of California. - * All rights reserved. - * Copyright (c) 1994 John S. Dyson - * All rights reserved. - * Copyright (c) 1994 David Greenman - * All rights reserved. - * Copyright (c) 2005 Yahoo! Technologies Norway AS - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * The Mach Operating System project at Carnegie-Mellon University. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * - * Copyright (c) 1987, 1990 Carnegie-Mellon University. - * All rights reserved. - * - * Authors: Avadis Tevanian, Jr., Michael Wayne Young - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -static int vm_swap_enabled = 0; -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, CTLFLAG_RD, - &vm_swap_enabled, 0, - "Enable entire process swapout"); - -static int vm_swap_idle_enabled = 0; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, CTLFLAG_RD, - &vm_swap_idle_enabled, 0, - "Allow swapout on idle criteria");