x86 hvm: Improve paging performance for 64b solaris guests
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 5 Jun 2008 09:36:19 +0000 (10:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 5 Jun 2008 09:36:19 +0000 (10:36 +0100)
The following patch provides a 'fast-path' for sh_remove_write_access()
for 64 bit Solaris HVM guests. This provides a significant performance
boost for such guests; our testing shows a 200-400% improvement in
microbenchmarks such as fork(), exit(), etc...

From: Gary Pennington <Gary.Pennington@sun.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/mm/shadow/multi.c
xen/include/asm-x86/perfc_defn.h

index 35a51743e7dac7a470e283f9961709d9bc94c1fc..aa3bc47d74565f80f19814810ca1d10fa753d475 100644 (file)
@@ -1738,6 +1738,11 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
             gfn = mfn_to_gfn(v->domain, gmfn); 
             GUESS(0xffff810000000000UL + (gfn << PAGE_SHIFT), 4); 
             GUESS(0x0000010000000000UL + (gfn << PAGE_SHIFT), 4); 
+            /*
+             * 64bit Solaris kernel page map at
+             * kpm_vbase; 0xfffffe0000000000UL
+             */
+            GUESS(0xfffffe0000000000UL + (gfn << PAGE_SHIFT), 4);
         }
 #endif /* CONFIG_PAGING_LEVELS >= 4 */
 
index d8fdf1c8168da65b32d97369557935d30664cee9..deb12887f7d40acf6ec41b37c0625be7c7174e4c 100644 (file)
@@ -4007,7 +4007,9 @@ int sh_rm_write_access_from_l1(struct vcpu *v, mfn_t sl1mfn,
     shadow_l1e_t *sl1e;
     int done = 0;
     int flags;
+#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC 
     mfn_t base_sl1mfn = sl1mfn; /* Because sl1mfn changes in the foreach */
+#endif
     
     SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, done, 
     {
index cc3906f0149d6660a191e97ac93a60c31ee074d4..000743157c8c233cdc0213b9788ab1666a6c0dae 100644 (file)
@@ -77,8 +77,7 @@ PERFCOUNTER(shadow_writeable,      "shadow removes write access")
 PERFCOUNTER(shadow_writeable_h_1,  "shadow writeable: 32b w2k3")
 PERFCOUNTER(shadow_writeable_h_2,  "shadow writeable: 32pae w2k3")
 PERFCOUNTER(shadow_writeable_h_3,  "shadow writeable: 64b w2k3")
-PERFCOUNTER(shadow_writeable_h_4,  "shadow writeable: 32b linux low")
-PERFCOUNTER(shadow_writeable_h_5,  "shadow writeable: 32b linux high")
+PERFCOUNTER(shadow_writeable_h_4,  "shadow writeable: linux/solaris")
 PERFCOUNTER(shadow_writeable_bf,   "shadow writeable brute-force")
 PERFCOUNTER(shadow_mappings,       "shadow removes all mappings")
 PERFCOUNTER(shadow_mappings_bf,    "shadow rm-mappings brute-force")