diff options
author | alc <alc@FreeBSD.org> | 2016-01-16 04:41:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2016-01-16 04:41:40 +0000 |
commit | 2c013a8511be7a44ec4dc02eb82e437477b41f78 (patch) | |
tree | ae0b96de9d39edf2d9f5af248e9bed2814fa9b76 /sys/vm | |
parent | bfe292335891cdc9c489c6ddde746c493b2351b5 (diff) | |
download | FreeBSD-src-2c013a8511be7a44ec4dc02eb82e437477b41f78.zip FreeBSD-src-2c013a8511be7a44ec4dc02eb82e437477b41f78.tar.gz |
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
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_phys.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 38799f2..3979513 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1372,12 +1372,12 @@ restartdom: 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 |