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 returning 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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/vm/vm_page.c | ||
---|---|---|
2200 | This has to move. If "reclaim" succeeds, you don't want to do this. |
sys/vm/vm_page.c | ||
---|---|---|
2205–2208 | The indentation looks wrong. | |
2229–2231 | As an aside, I find this KASSERT confusing because we disallow VM_ALLOC_WAITOK in the very first KASSERT. | |
2246 | As an aside, I don't see the point of this loop because because we disallow VM_ALLOC_WAITOK in the very first KASSERT. Kostik? Mark? | |
sys/vm/vm_reserv.c | ||
1390–1397 | This could all be performed after the reservation is unlocked. | |
1402 | This can be done before marking the pages as allocated. |