aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Moore <dougm@FreeBSD.org>2021-12-26 17:40:27 +0000
committerDoug Moore <dougm@FreeBSD.org>2021-12-26 17:40:27 +0000
commit49fd2d51f07fb29af3fd239f83f249c00cd84123 (patch)
tree3079fc0ccb34c61b9d2b629d8ae3388ecd21b9d1
parent2e59c9c7f01e9e8878664f59438d1ed6c27d0e2b (diff)
downloadsrc-49fd2d51f07fb29af3fd239f83f249c00cd84123.tar.gz
src-49fd2d51f07fb29af3fd239f83f249c00cd84123.zip
vm_reserv: fix zero-boundary error
Handle specially the boundary==0 case of vm_reserv_reclaim_config, by turning off boundary adjustment in that case. Reviewed by: alc Tested by: pho, madpilot
-rw-r--r--sys/vm/vm_reserv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index 3709283c5556..b4902942224d 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -1333,7 +1333,7 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low,
* doesn't include a boundary-multiple within it. Otherwise,
* no boundary-constrained allocation is possible.
*/
- if (size > boundary)
+ if (size > boundary && boundary > 0)
return (NULL);
marker = &vm_rvd[domain].marker;
queue = &vm_rvd[domain].partpop;
@@ -1344,7 +1344,8 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low,
*/
ppn_align = (int)(ulmin(ulmax(PAGE_SIZE, alignment),
VM_LEVEL_0_SIZE) >> PAGE_SHIFT);
- ppn_bound = (int)(MIN(MAX(PAGE_SIZE, boundary),
+ ppn_bound = boundary == 0 ? VM_LEVEL_0_NPAGES :
+ (int)(MIN(MAX(PAGE_SIZE, boundary),
VM_LEVEL_0_SIZE) >> PAGE_SHIFT);
vm_reserv_domain_scan_lock(domain);