mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
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
This commit is contained in:
parent
2e59c9c7f0
commit
49fd2d51f0
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue