Re: optimize pagedaemon settings

Mark Millard <[email protected]> Thu, 4 Jun 2026 16:53:23 -0700
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <[email protected]>
On 6/4/26 13:18, Rozhuk Ivan wrote:
> On Thu, 4 Jun 2026 12:00:25 -0400
> Mark Johnston <[email protected]> wrote:
> 
>> 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.
> 
> No, there is no swap configured.
> 
> Ok, but is it possible to do something with pagedaemon to reduce CPU usage?
> 
> 

[My listing [email protected] as a place to send responses ends up with
google bouncing the message back to me. Thus my removal.]

Your original message listed:

vm.act_scan_laundry_weight=16		# weight given to clean vs. dirty pages
in active queue scans / def: 3

My understanding is that you have told the pageaemon to send more of its
time trying to pageout the laundry and less of its time scanning the
inactive queue for already inactive ppages to free  --when you have also
configured to have no swap space to do a pageout to.

Mark J. may be able to confirm if this is leading to more cpu effort
being spent not doing useful work. He may be able to comment for other
things as well.

(My guess is that vm.act_scan_laundry_weight should not be used to try
to disable laundry scanning, even when there is no swap space configured
to be in use.)

Some settings may be no-ops for your no-SWAP context. Possibly including:

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


Note:

15.* and main FreeBSD OS's no longer support:

vm.swap_enabled=0			# Enable entire process swapout

15 never swaps out the kernel stacks any more. In fact, for 15.* and main:

# sysctl vm.swap_enabled
sysctl: unknown oid 'vm.swap_enabled'

# sysctl -d vm.swap_idle_enabled
sysctl: unknown oid 'vm.swap_idle_enabled'

Both are still in 14.* of FreeBSD OS.


You might want to provide a more general description of your workload(s)
being manged and system configuration and ask a more general question
about appropriate configuration settings, possibly spanning changes in
15.* .


-- 
===
Mark Millard
marklmi at yahoo.com