diff options
author | dyson <dyson@FreeBSD.org> | 1996-10-13 01:38:37 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-10-13 01:38:37 +0000 |
commit | 154b44fb0a407fda8021c14d48dc08625f97bdbc (patch) | |
tree | 595b258aa1593830a025b1d49f0e526d905bd205 /sys | |
parent | 26b6cb48f6b4e927405282de17db48afa0c64e3f (diff) | |
download | FreeBSD-src-154b44fb0a407fda8021c14d48dc08625f97bdbc.zip FreeBSD-src-154b44fb0a407fda8021c14d48dc08625f97bdbc.tar.gz |
Minor optimization for final rundown of a pmap.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b5d0596..c602cdc 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.124 1996/10/12 20:36:15 bde Exp $ + * $Id: pmap.c,v 1.125 1996/10/12 21:35:03 dyson Exp $ */ /* @@ -1443,6 +1443,9 @@ pmap_remove(pmap, sva, eva) if (pmap == NULL) return; + if (pmap->pm_stats.resident_count == 0) + return; + /* * special handling of removing one page. a very * common operation and easy to short circuit some @@ -1470,6 +1473,8 @@ pmap_remove(pmap, sva, eva) * Calculate index for next page table. */ pdnxt = ((sindex + NPTEPG) & ~(NPTEPG - 1)); + if (pmap->pm_stats.resident_count == 0) + break; ptpaddr = (vm_offset_t) *pmap_pde(pmap, i386_ptob(sindex)); /* diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index b5d0596..c602cdc 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.124 1996/10/12 20:36:15 bde Exp $ + * $Id: pmap.c,v 1.125 1996/10/12 21:35:03 dyson Exp $ */ /* @@ -1443,6 +1443,9 @@ pmap_remove(pmap, sva, eva) if (pmap == NULL) return; + if (pmap->pm_stats.resident_count == 0) + return; + /* * special handling of removing one page. a very * common operation and easy to short circuit some @@ -1470,6 +1473,8 @@ pmap_remove(pmap, sva, eva) * Calculate index for next page table. */ pdnxt = ((sindex + NPTEPG) & ~(NPTEPG - 1)); + if (pmap->pm_stats.resident_count == 0) + break; ptpaddr = (vm_offset_t) *pmap_pde(pmap, i386_ptob(sindex)); /* |