CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/04/10 19:57:22

Modified files:
        sys/uvm        : uvm_pdaemon.c 

Log message:
When the pagedaemon is triggered to create free memory, there may be
sleeping pmemrange allocations with multi-page alignment requirements
which can't be satisfied by the simplistic freeing of (solo) pages
which the pagedaemon performs.  As we near starvation, fragmentation
is the main problem.  Our free list could be large enough that the
pagedaemon sees no reason to do more work, but also too fragmented to
satisfy a pending allocation request with complex requirements
(imagine asking for 512K of physically linear memory which is DMA
reachable).  When the requirement isn't satisfied, the pagedaemon is
told to try again, but again doesn't mean harder because it has no
mechanism to try harder.  It's tracking variables do not show the
fragmentation problem.  It spins a lot.  Often this becomes a
deadlock.
Time to change strategy: Overshoot creation of (both) inactive and
free pages each time through the loop. After inspecting existing
variables, we generate minumum 128 inactive pages (which may be
dynamically drawn down asyncronously by accesses), and then try to
convert minumum 128 inactives into free pages (different pages
get freed different ways, including via swapcluster which has been
improved in previous uvm_swap.c commit to absorb more pressure and
indicate when it is full).
As we mow through the freelist, this will eventually create some
(physical address space) defragmention and satisfy these complex
requirements.  Maybe not on the first round, but it will keep trying.
Before this change, it was not trying at all.
ok kettenis kirill beck

Reply via email to