diff options
author | dyson <dyson@FreeBSD.org> | 1996-07-27 03:24:10 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-07-27 03:24:10 +0000 |
commit | 293abd3564090ccf9196bbd4bc949163b91fce62 (patch) | |
tree | e65b39cf45164a5e0f930222b2d2e90148f2f518 /sys/i386/include/pmap.h | |
parent | 5306d9c9d6bc06b09eb3c7ca700475faafbee5c1 (diff) | |
download | FreeBSD-src-293abd3564090ccf9196bbd4bc949163b91fce62.zip FreeBSD-src-293abd3564090ccf9196bbd4bc949163b91fce62.tar.gz |
This commit is meant to solve a couple of VM system problems or
performance issues.
1) The pmap module has had too many inlines, and so the
object file is simply bigger than it needs to be.
Some common code is also merged into subroutines.
2) Removal of some *evil* PHYS_TO_VM_PAGE macro calls.
Unfortunately, a few have needed to be added also.
The removal caused the need for more vm_page_lookups.
I added lookup hints to minimize the need for the
page table lookup operations.
3) Removal of some bogus performance improvements, that
mostly made the code more complex (tracking individual
page table page updates unnecessarily). Those improvements
actually hurt 386 processors perf (not that people who
worry about perf use 386 processors anymore :-)).
4) Changed pv queue manipulations/structures to be TAILQ's.
5) The pv queue code has had some performance problems since
day one. Some significant scalability issues are resolved
by threading the pv entries from the pmap AND the physical
address instead of just the physical address. This makes
certain pmap operations run much faster. This does
not affect most micro-benchmarks, but should help loaded system
performance *significantly*. DG helped and came up with most
of the solution for this one.
6) Most if not all pmap bit operations follow the pattern:
pmap_test_bit();
pmap_clear_bit();
That made for twice the necessary pv list traversal. The
pmap interface now supports only pmap_tc_bit type operations:
pmap_[test/clear]_modified, pmap_[test/clear]_referenced.
Additionally, the modified routine now takes a vm_page_t arg
instead of a phys address. This eliminates a PHYS_TO_VM_PAGE
operation.
7) Several rewrites of routines that contain redundant code to
use common routines, so that there is a greater likelihood of
keeping the cache footprint smaller.
Diffstat (limited to 'sys/i386/include/pmap.h')
-rw-r--r-- | sys/i386/include/pmap.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index dbadf6f..b53db62 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -42,12 +42,13 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.39 1996/05/18 03:36:38 dyson Exp $ + * $Id: pmap.h,v 1.40 1996/06/08 11:21:19 bde Exp $ */ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ + /* * Page-directory and page-table entires follow this format, with a few * of the fields not present here and there, depending on a lot of things. @@ -113,6 +114,9 @@ #define ISA_HOLE_LENGTH (0x100000-ISA_HOLE_START) #ifndef LOCORE + +#include <sys/queue.h> + typedef unsigned int *pd_entry_t; typedef unsigned int *pt_entry_t; @@ -158,17 +162,24 @@ pmap_kextract(vm_offset_t va) } #endif +struct vm_page; + /* * Pmap stuff */ +struct pv_entry; +typedef struct { + int pv_list_count; + TAILQ_HEAD(,pv_entry) pv_list; +} pv_table_t; struct pmap { pd_entry_t *pm_pdir; /* KVA of page directory */ vm_object_t pm_pteobj; /* Container for pte's */ - short pm_dref; /* page directory ref count */ - short pm_count; /* pmap reference count */ + pv_table_t pm_pvlist; /* list of mappings in pmap */ + int pm_count; /* reference count */ struct pmap_statistics pm_stats; /* pmap statistics */ - struct vm_map *pm_map; /* map that owns this pmap */ + struct vm_page *pm_ptphint; /* pmap ptp hint */ }; typedef struct pmap *pmap_t; @@ -177,14 +188,16 @@ typedef struct pmap *pmap_t; extern pmap_t kernel_pmap; #endif + /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_table. */ typedef struct pv_entry { - struct pv_entry *pv_next; /* next pv_entry */ pmap_t pv_pmap; /* pmap where mapping lies */ vm_offset_t pv_va; /* virtual address for mapping */ + TAILQ_ENTRY(pv_entry) pv_list; + TAILQ_ENTRY(pv_entry) pv_plist; vm_page_t pv_ptem; /* VM page for pte */ } *pv_entry_t; @@ -200,7 +213,7 @@ extern pt_entry_t *CMAP1; extern vm_offset_t avail_end; extern vm_offset_t avail_start; extern vm_offset_t phys_avail[]; -extern pv_entry_t *pv_table; /* array of entries, one per page */ +pv_table_t *pv_table; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; |