HomeFreeBSD

vm_phys: fix freelist_contig

Description

vm_phys: fix freelist_contig

vm_phys_find_freelist_contig is called to search a list of max-sized
free page blocks and find one that, when joined with adjacent blocks
in memory, can satisfy a request for a memory allocation bigger than
any single max-sized free page block. In commit
fa8a6585c7522b7de6d29802967bd5eba2f2dcf1, I defined this function in
order to offer two improvements: 1) reduce the worst-case search time,
and 2) allow solutions that include less-than max-sized free page
blocks at the front or back of the giant allocation. However, it turns
out that this change introduced an error, reported in In Bug

  1. That error concerns failing to check segment boundaries. This

change fixes an error in vm_phys_find_freelist_config that resolves
that bug. It also abandons improvement 2), because the value of that
improvement is small and because preserving it would require more
testing than I am able to do.

PR: 274592
Reported by: shafaisal.us@gmail.com
Reviewed by: alc, markj
Tested by: shafaisal.us@gmail.com
Fixes: fa8a6585c752 vm_phys: avoid waste in multipage allocation
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D42509
Approved by: so
Security: FreeBSD-EN-23:20.vm

(cherry picked from commit 2a4897bd4e1bd8430d955abd3cf6675956bb9d61)
(cherry picked from commit 210fce73ae0e4106a3aeb1970ffbeb30d0baa6ba)

Details

Provenance
dougmAuthored on Nov 15 2023, 9:25 AM
markjCommitted on Dec 4 2023, 2:05 PM
Reviewer
rGfa8a6585c752: vm_phys: avoid waste in multipage allocation
Differential Revision
D42509: vm_phys: fix freelist_contig
Parents
rGad3edd66d15e: pkgbase: use <major>.<minor> format for alpha, beta and release package versions
Branches
Unknown
Tags
Unknown