diff options
author | dillon <dillon@FreeBSD.org> | 2001-11-03 01:08:55 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-11-03 01:08:55 +0000 |
commit | 206c5d779ec76d32b6647bf282ddd75945308372 (patch) | |
tree | fdd455a3e0828f95ff9a2489f38684416f207084 /sys/alpha | |
parent | 84073a96d15842669bb7f01d421918949077c1ec (diff) | |
download | FreeBSD-src-206c5d779ec76d32b6647bf282ddd75945308372.zip FreeBSD-src-206c5d779ec76d32b6647bf282ddd75945308372.tar.gz |
Implement i386/i386/pmap.c 1.292 for alpha, ia64 (avoid free
page exhaustion / kernel panic for certain madvise() scenarios)
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/pmap.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index c03d3dd..21dfef1 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -2466,7 +2466,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, psize = alpha_btop(size); if ((object->type != OBJT_VNODE) || - (limit && (psize > MAX_INIT_PT) && + ((limit & MAP_PREFAULT_PARTIAL) && (psize > MAX_INIT_PT) && (object->resident_page_count > MAX_INIT_PT))) { return; } @@ -2494,6 +2494,14 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, if (tmpidx >= psize) { continue; } + /* + * don't allow an madvise to blow away our really + * free pages allocating pv entries. + */ + if ((limit & MAP_PREFAULT_MADVISE) && + cnt.v_free_count < cnt.v_free_reserved) { + break; + } if (((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && (p->flags & (PG_BUSY | PG_FICTITIOUS)) == 0) { if ((p->queue - p->pc) == PQ_CACHE) @@ -2511,6 +2519,14 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, * else lookup the pages one-by-one. */ for (tmpidx = 0; tmpidx < psize; tmpidx += 1) { + /* + * don't allow an madvise to blow away our really + * free pages allocating pv entries. + */ + if ((limit & MAP_PREFAULT_MADVISE) && + cnt.v_free_count < cnt.v_free_reserved) { + break; + } p = vm_page_lookup(object, tmpidx + pindex); if (p && ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && |