aboutsummaryrefslogtreecommitdiffstats
path: root/tools/misc/xen-hvmctx.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-27 09:04:46 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-27 09:04:46 +0100
commit06ef473029dcd540b7e4fb76f89cc54fd53a840e (patch)
tree249c7b6f44168e2d7ee1d631c892e2130e2df2cb /tools/misc/xen-hvmctx.c
parent92ed5b7e9c642ff0f7c68eb8a39bd687726ba03c (diff)
downloadxen-06ef473029dcd540b7e4fb76f89cc54fd53a840e.tar.gz
xen-06ef473029dcd540b7e4fb76f89cc54fd53a840e.tar.bz2
xen-06ef473029dcd540b7e4fb76f89cc54fd53a840e.zip
x86: Speed up PV-guest superpage mapping
The current version of superpage mapping takes a PGT_writable reference to every page in a superpage each time it is mapped. This is extremely slow, so slow that applications become unusable. My solution for this is to introduce a superpage table in the hypervisor, similar to the frametable structure for pages. Currently this table only has a type_info element. There are three types a superpage can have, SGT_mark, SGT_dynamic, or SGT_none. In normal operation, the first time a superpage is mapped, a PGT_writable reference is taken to each page in the superpage, and the superpage is set to type SGT_dynamic and the superpage typecount is incremented. On subsequent mappings and unmappings, only the superpage typecount changes. On the last unmap, the PGT_writable reference on each page is removed. The SGT_mark type is set and cleared through two new MMUEXT hypercalls, mark_super and unmark_super. When the hypercall is made, the superpage's type is set to SGT_mark and a PGT_writable reference is taken to its pages. On unmark, the type is cleared and the reference removed. If a page is already set to SGT_dynamic when mark_super is called, the type is changed to SGT_mark and no additional PGT_writable reference is taken. If there are still outstanding mappings of this superpage when unmark_super is called, the type is set to SGT_dynamic and the PGT_writable reference is not removed. Fast superpage mapping is only supported on 64 bit hypervisors. For 32 bit hyperviors, superpage mapping is supported but will be extremely slow. Signed-off-by: Dave McCracken <dave.mccracken@oracle.com>
Diffstat (limited to 'tools/misc/xen-hvmctx.c')
0 files changed, 0 insertions, 0 deletions