diff --git a/lib/libsys/getrlimit.2 b/lib/libsys/getrlimit.2 --- 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 @@ 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 --- 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 @@ .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 --- a/sys/conf/files +++ b/sys/conf/files @@ -5267,7 +5267,6 @@ 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 --- a/sys/vm/vm_swapout.c +++ b/sys/vm/vm_swapout.c @@ -122,33 +122,6 @@ }; 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 --- 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");