mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 00:33:57 +00:00
A fix to r292469: Iterate over the physical segments in descending rather
than ascending order in vm_phys_alloc_contig() so that, for example, a sequence of contigmalloc(low=0, high=4GB) calls doesn't exhaust the supply of low physical memory resulting in a later contigmalloc(low=0, high=1MB) failure. Reported by: cy Tested by: cy Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
f4ce06a920
commit
477bffbe4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294130
|
@ -1372,12 +1372,12 @@ vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
|
|||
return (NULL);
|
||||
}
|
||||
m_run = NULL;
|
||||
for (segind = 0; segind < vm_phys_nsegs; segind++) {
|
||||
for (segind = vm_phys_nsegs - 1; segind >= 0; segind--) {
|
||||
seg = &vm_phys_segs[segind];
|
||||
if (seg->start >= high)
|
||||
break;
|
||||
if (low >= seg->end || seg->domain != domain)
|
||||
if (seg->start >= high || seg->domain != domain)
|
||||
continue;
|
||||
if (low >= seg->end)
|
||||
break;
|
||||
if (low <= seg->start)
|
||||
pa_start = seg->start;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue