diff options
author | tegge <tegge@FreeBSD.org> | 1998-09-06 23:04:20 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 1998-09-06 23:04:20 +0000 |
commit | 73bcd2203955610546f0962d9d9cc627eb7b0d91 (patch) | |
tree | 5f1fa06c96c5df4c93531992ae43e753c1060257 /sys | |
parent | e20ec1375043132d77075262757378832898942a (diff) | |
download | FreeBSD-src-73bcd2203955610546f0962d9d9cc627eb7b0d91.zip FreeBSD-src-73bcd2203955610546f0962d9d9cc627eb7b0d91.tar.gz |
Don't go below the low water mark of free pages due to optional prefaulting
of pages.
PR: 2431
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 11 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 76f5bcf..2be04c8 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.207 1998/08/23 10:16:25 bde Exp $ + * $Id: pmap.c,v 1.208 1998/09/04 13:10:34 ache Exp $ */ /* @@ -2717,6 +2717,15 @@ pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr) panic("pmap_copy: invalid to pmap_copy page tables\n"); #endif + /* + * Don't let optional prefaulting of pages make us go + * way below the low water mark of free pages or way + * above high water mark of used pv entries. + */ + if (cnt.v_free_count < cnt.v_free_reserved || + pv_entry_count > pv_entry_high_water) + break; + pdnxt = ((addr + PAGE_SIZE*NPTEPG) & ~(PAGE_SIZE*NPTEPG - 1)); ptepindex = addr >> PDRSHIFT; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 76f5bcf..2be04c8 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.207 1998/08/23 10:16:25 bde Exp $ + * $Id: pmap.c,v 1.208 1998/09/04 13:10:34 ache Exp $ */ /* @@ -2717,6 +2717,15 @@ pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr) panic("pmap_copy: invalid to pmap_copy page tables\n"); #endif + /* + * Don't let optional prefaulting of pages make us go + * way below the low water mark of free pages or way + * above high water mark of used pv entries. + */ + if (cnt.v_free_count < cnt.v_free_reserved || + pv_entry_count > pv_entry_high_water) + break; + pdnxt = ((addr + PAGE_SIZE*NPTEPG) & ~(PAGE_SIZE*NPTEPG - 1)); ptepindex = addr >> PDRSHIFT; |