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

Details

Provenance
dougmAuthored on Nov 15 2023, 9:25 AM
Reviewer
rGfa8a6585c752: vm_phys: avoid waste in multipage allocation
Differential Revision
D42509: vm_phys: fix freelist_contig
Parents
rGede077bf2a25: sys: Disable -Walloc-size-larger-than for GCC 9+
Branches
Unknown
Tags
Unknown