From nobody Thu Jun 04 16:00:25 2026 X-Original-To: freebsd-hackers@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 4gWTmq6Ymdz6gXj4 for ; Thu, 04 Jun 2026 16:00:27 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gWTmq5lR6z42d3; Thu, 04 Jun 2026 16:00:27 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780588827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pcF6TsCvl+cwXD7RenGrVoGZI2lNj38iuE3AttWW2Tk=; b=fWUtAJwx/p5MffPpmhzylSuuP/iETxYkASxToc2/8+dtvRx+hQ175aS6spMeu0VnN9rnW4 Ejv98FtI5h5ESAQ8ArRrX1zCSVrS5+mUL3yz6PLC/4THJQkuidcQgm+OHeowPmBVdusWrT /PEJqh1u2dxylZ8rdO2Kih4xoR8Cf5IlvtGa+jZfOsKjUliUSlK09nXrYxL5DxG/MePpYW 7nuCReOpQ4K+6HDUkfqCZEe1D5ZwdgWFBB+yF6YHCsKErHg5q5eRNFs9vtiGLaxMZr5Vtw ZRYBtVOtHGpqDPVuBQvXtNHpVdhp9bk/nowi0H0RtUEn3Yu7u3SxOzCK8GYXxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780588827; a=rsa-sha256; cv=none; b=GrYHNyrN9Q7tsXobZu/+/Jky5+MIHhx8cKqq2mdD3NfRxucI9jV2o9zrcR74oQ3t9hryiK hMw5002ugugSvfTBVTeG+kuUN1WFYqoFTIUJkcG0aGpskGKqYqL8g+KKza0Y1cQixFHiHm aJIE0waOg/mu7UTfVLaUFP+WOdGN68SJsEyIGaxRc2m/45gAe2WTi/a022YON8hoXeqhIn Q6JxhEv9/ebfaOnl2fs5Dh0oOgbSLfXM3kfgVI/qXIJoli7lM8V/VEu6afIESxe+PACyLN d1SvdQslkidoxB8vlngvrRlX3bSPcgzThh31JuiX4v/bfzWOFfqoCjCgYqLLbg== 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=1780588827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pcF6TsCvl+cwXD7RenGrVoGZI2lNj38iuE3AttWW2Tk=; b=rnEKEQumW/qGE+YCZMavqr18r2sJTLXenari2u9gCnSsUhmuIdLiOih2liHTJoqjJoMSAN 3u4VnY9HWL+xhq0P4oGUggzRZAwz1J9V5OprQopEprmQmDpee4yAoAKWu83io7ZfjVKxph IdiFn/n9+mWox2nRfNngT9wBCUVIDMEFgdw0iZJBqsTAVcifRBhOQqHCDxIb7EvU8kBowt CLipoHW9/M97Hqr6cY/LjCXpSeKHsyabn+JqhU2VxeS5owATa6ryWXKpkDRaroqS2f0CG9 5YIBYCYjieOQeuXoXaAHlscZva7tRrB3S4JaY151ylIZZt4sHN4zlaa2t6JZaA== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gWTmq48Ggz16bN; Thu, 04 Jun 2026 16:00:27 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Thu, 4 Jun 2026 12:00:25 -0400 From: Mark Johnston To: Rozhuk Ivan Cc: freebsd-hackers@freebsd.org Subject: Re: optimize pagedaemon settings Message-ID: References: <20260603023300.24974be1@rimwks.local> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260603023300.24974be1@rimwks.local> On Wed, Jun 03, 2026 at 02:33:00AM +0300, Rozhuk Ivan wrote: > Hi! > > > Is it possible to tune something in sysctl to reduce CPU usage by "pagedaemon" and convert more "Laundry" to "Free"? > > > > .... > Mem: 25G Active, 242M Inact, 67G Laundry, 31G Wired, 1505M Buf, 878M Free Is there no swap configured on this system? If not, then the pagedaemon cannot reclaim those laundry pages. > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 65951 nobody 33 141 0 36G 33G CPU16 16 63.2H 2711.41% /usr/local/bin/llama-server --cpu-strict 1 --host 127.0.0.1 --mmap --no-host --offline -- > 7 root 3 -15 - 0B 72K CPU0 0 766:00 100.06% [pagedaemon] > 1086 rim 44 111 0 8555M 4020M CPU24 24 32.1H 97.92% /usr/local/lib/firefox/firefox -contentproc -isForBrowser -prefsHandle 0:49179 -prefMapHan > 98907 rim 384 1 0 46G 13G select 9 42.6H 58.60% /usr/local/bin/firefox -P default > 84880 rim 47 29 0 801M 253M select 3 4:45 44.80% iridium: --type=gpu-process --ozone-platform=x11 --enable-crash-reporter=, --change-stack- > .... > > > My current settings: > vm.cluster_anon=2 # Cluster anonymous mappings: 0 = no, 1 = yes if no hint, 2 = always // def: 1 > vm.overcommit=0 # Configure virtual memory overcommit behavior. See tuning(7) for details. > vm.pageout_update_period=20 # Maximum active LRU update period (seconds) > vm.lowmem_period=2 # Low memory callback period (seconds) > vm.act_scan_laundry_weight=16 # weight given to clean vs. dirty pages in active queue scans / def: 3 > vm.background_launder_rate=65536 # background laundering rate, in kilobytes per second / def: 4096 > vm.background_launder_max=524288 # background laundering cap, in kilobytes / def: 20*1024 > vm.domain.0.pageout_helper_threads_enabled=1 # Enable multi-threaded inactive queue scanning / see also vm.pageout_cpus_per_thread / def: 1 > vm.domain.1.pageout_helper_threads_enabled=1 # Enable multi-threaded inactive queue scanning / see also vm.pageout_cpus_per_thread / def: 1 > vm.domain.2.pageout_helper_threads_enabled=1 # Enable multi-threaded inactive queue scanning / see also vm.pageout_cpus_per_thread / def: 1 > vm.domain.3.pageout_helper_threads_enabled=1 # Enable multi-threaded inactive queue scanning / see also vm.pageout_cpus_per_thread / def: 1 > vm.swap_enabled=0 # Enable entire process swapout > vm.swap_idle_enabled=1 # Allow swapout on idle criteria / def: 0 > vm.swap_idle_threshold1=4 # Guaranteed swapped in time for a process / def: 2 > vm.swap_idle_threshold2=16 # Time before a process will be swapped out / def: 10 > vm.disable_swapspace_pageouts=0 # Disallow swapout of dirty pages / def: 0 > vm.kstack_cache_size=512 # Maximum number of cached kernel stacks > > >