]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vm: alloc pages from reserv before breaking it
authorDoug Moore <dougm@FreeBSD.org>
Fri, 24 Dec 2021 18:59:16 +0000 (12:59 -0600)
committerDoug Moore <dougm@FreeBSD.org>
Mon, 11 Jul 2022 05:41:07 +0000 (00:41 -0500)
commit88a5d20e90438735cb456ba04055c26073c12057
treeedfabf4f22a628b53fbdcad0f8b34865156bf5e5
parentb52d35520c51b885f68256b1b5cd1931d07add49
vm: alloc pages from reserv before breaking it

Function vm_reserv_reclaim_contig breaks a reservation with enough
free space to satisfy an allocation request and returns the free space
to the buddy allocator. Change the function to allocate the request
memory from the reservation before breaking it, and return that memory
to the caller. That avoids a second call to the buddy allocator and
guarantees successful allocation after breaking the reservation, where
that success is not currently guaranteed.

Reviewed by: alc, kib (previous version)
Differential Revision: https://reviews.freebsd.org/D33644

(cherry picked from commit 0d5fac287294490ac488d74e598e019334610bdb)
sys/vm/vm_page.c
sys/vm/vm_reserv.c
sys/vm/vm_reserv.h