diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-02-22 03:26:25 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-02-22 03:26:25 +0000 |
commit | d32e53c677b47f55b56a3567e6f49ea0ef24e159 (patch) | |
tree | 6179f7649621974b18d4042da5a2e4aedd70b7bc /sys/arch/powerpc/include | |
parent | 03aaa5c436b88840034be4523838a1097bd69492 (diff) |
Improve the page mapped check algorithm in the powerpc pmap module,
before it was looking through two arrays of 8 and a linked list of
undetermined size, before deciding that a mapping was not valid.
Now it allocates a data structure and caches that data.
This improves both pmap_enter and pmap_remove because both check
to see if a mapping is valid before taking the appropriate actions.
Also in pmap_remove, if the va mapping is found, stop searching for
it in the rest of this array, the alternate array and the linked list.
only one valid mapping of each va is allowed.
This change improved lat_mmap (from lmbench) from 1300 to 720
and fork+exit from 7320 to 2724 microseconds.
Diffstat (limited to 'sys/arch/powerpc/include')
-rw-r--r-- | sys/arch/powerpc/include/pmap.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/powerpc/include/pmap.h b/sys/arch/powerpc/include/pmap.h index ab4053d1a84..3f54e7ad34e 100644 --- a/sys/arch/powerpc/include/pmap.h +++ b/sys/arch/powerpc/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.3 1997/01/09 03:03:46 rahnds Exp $ */ +/* $OpenBSD: pmap.h,v 1.4 2001/02/22 03:26:23 drahn Exp $ */ /* $NetBSD: pmap.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */ /*- @@ -49,12 +49,25 @@ typedef u_int sr_t; #define SR_VSID 0x00ffffff #ifndef _LOCORE +/* V->P mapping data */ +typedef int pmapv_t; +#define VP_SR_SIZE 32 +#define VP_SR_MASK VP_SR_SIZE-1 +#define VP_SR_POS 27 +#define VP_IDX1_SIZE 1024 +#define VP_IDX1_MASK VP_IDX1_SIZE-1 +#define VP_IDX1_POS 17 +#define VP_IDX2_SIZE 32 +#define VP_IDX2_MASK VP_IDX2_SIZE-1 +#define VP_IDX2_POS 12 + /* * Pmap stuff */ struct pmap { sr_t pm_sr[16]; /* segments used in this pmap */ int pm_refs; /* ref count */ + pmapv_t *vps[VP_SR_SIZE]; /* virtual to physical table */ struct pmap_statistics pm_stats; /* pmap statistics */ }; |