CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/01/28 14:46:03
Modified files:
sys/uvm : uvm_pdaemon.c
Log message:
In uvm_pdaemon.c 1.121, 1.122, and 1.123, two things happened:
1. The shortage target inside uvmpd_scan() / uvmpd_scan_inactive() which
used to be computed using the realtime uvmexp.free value, was replaced with a
(historic prediction) using the pre-existing pagedaemon "shortage" variable.
This means the scanner will continue work even if the system recovers
memory asyncronously and has resolved the scarcity which caused the pagedaemon
to be summoned. That's a bad idea. The code should revert to observing
realtime system conditions. We don't have a diff for that yet, but the
other concern is immediate:
2. The pre-existing calculation of the "shortage" variable was changed
significally, without verifying correct behaviour.
size += shortage;
...
shortage -= bufbackoff(&constraint, size * 2);
since bufbackoff() returns how much it did, and generally succeeds at
satisfying the full request size * 2, that is effectively "shortage =
-shortage". The scan function changes still expect a positive target
value. The result is uvmpd_scan_inactive() runs the entire list, which
delays the pagedaemon performing it's other roles (wakeups, looking
around to choose new targets, and use other cheaper memory recovery
mechanisms). This diff works around that by clamping negative to 0.
ok claudio beck