diff options
author | attilio <attilio@FreeBSD.org> | 2011-10-30 00:57:56 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2011-10-30 00:57:56 +0000 |
commit | b29030ce37e1b81d952e6533c3a29e7176e3ec9e (patch) | |
tree | bb3104b1e8c115dc1118a1df123e7593c1d24d50 /sys/amd64/include/pmap.h | |
parent | 1f2c60154da2d3fb71c8c1d82766c1d189f6fb98 (diff) | |
download | FreeBSD-src-b29030ce37e1b81d952e6533c3a29e7176e3ec9e.zip FreeBSD-src-b29030ce37e1b81d952e6533c3a29e7176e3ec9e.tar.gz |
Reimplement the splay tree used for idle page table pages using
md_page iterators. Additively, embed the left and right pointers as an
union with the pv_list as the page table pages don't need reverse
mapping. This way, this code is no longer using the root and left
iterators from the vm_page itself and once the red/black algorithm for
cached pages will be implemented will allow removing completely the
extra two pointers from vm_page.
Implementation notes: it is interesting to note that now
pmap_vmpage_splay() is just a copy&paste of the vm_page_splay(),
but working on the md_page iterators. This is necessary because in the
end the vm_page_splay() will be completely removed.
Also, note that pv_list iterator is renamed in a more "common" way
because of problems with macro expansions.
Outlined, discussed and reviewed by: jeff
Diffstat (limited to 'sys/amd64/include/pmap.h')
-rw-r--r-- | sys/amd64/include/pmap.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 1b8108a..eabf1dc 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -240,10 +240,20 @@ struct pv_entry; struct pv_chunk; struct md_page { - TAILQ_HEAD(,pv_entry) pv_list; - int pat_mode; + union { + TAILQ_HEAD(,pv_entry) pvi_list; + struct { + vm_page_t pii_left; + vm_page_t pii_right; + } pvi_siters; + } pv_structs; + int pat_mode; }; +#define pv_list pv_structs.pvi_list +#define pv_left pv_structs.pvi_siters.pii_left +#define pv_right pv_structs.pvi_siters.pii_right + /* * The kernel virtual address (KVA) of the level 4 page table page is always * within the direct map (DMAP) region. @@ -282,7 +292,7 @@ extern struct pmap kernel_pmap_store; */ typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ - TAILQ_ENTRY(pv_entry) pv_list; + TAILQ_ENTRY(pv_entry) pv_next; } *pv_entry_t; /* |