[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Delete old 'shortcut' function __shadow_status() and



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 1c69197d29b719cb42e73e0d26c024935fd18364
# Parent  ee9691e23dbe4c7a4e52acde3f7c207ae0659627
Delete old 'shortcut' function __shadow_status() and
rename the core function ___shadow_status() to take its
place.

The 'fast path quick test' was ridiculously bloated and
didn't work for PGT_fl1_shadow pages.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r ee9691e23dbe -r 1c69197d29b7 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Thu Feb  9 16:42:51 2006
+++ b/xen/arch/x86/shadow.c     Thu Feb  9 17:35:15 2006
@@ -3256,7 +3256,7 @@
     if ( !__shadow_get_l2e(v, va, &sl2e) )
         sl2e = l2e_empty();
 
-    l1_mfn = ___shadow_status(d, start_gpfn | nx, PGT_fl1_shadow);
+    l1_mfn = __shadow_status(d, start_gpfn | nx, PGT_fl1_shadow);
 
     /* Check the corresponding l2e */
     if (l1_mfn) {
diff -r ee9691e23dbe -r 1c69197d29b7 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Thu Feb  9 16:42:51 2006
+++ b/xen/include/asm-x86/shadow.h      Thu Feb  9 17:35:15 2006
@@ -1179,19 +1179,21 @@
  *      its mfn).
  *      It returns the shadow's mfn, or zero if it doesn't exist.
  */
-
-static inline unsigned long ___shadow_status(
+static inline unsigned long __shadow_status(
     struct domain *d, unsigned long gpfn, unsigned long stype)
 {
     struct shadow_status *p, *x, *head;
     unsigned long key = gpfn | stype;
 
+    ASSERT(shadow_lock_is_acquired(d));
+    ASSERT(gpfn == (gpfn & PGT_mfn_mask));
+    ASSERT(stype && !(stype & ~PGT_type_mask));
+
     perfc_incrc(shadow_status_calls);
 
     x = head = hash_bucket(d, gpfn);
     p = NULL;
 
-    //SH_VVLOG("lookup gpfn=%08x type=%08x bucket=%p", gpfn, stype, x);
     shadow_audit(d, 0);
 
     do
@@ -1221,7 +1223,6 @@
                 perfc_incrc(shadow_status_hit_head);
             }
 
-            //SH_VVLOG("lookup gpfn=%p => status=%p", key, head->smfn);
             return head->smfn;
         }
 
@@ -1230,51 +1231,8 @@
     }
     while ( x != NULL );
 
-    //SH_VVLOG("lookup gpfn=%p => status=0", key);
     perfc_incrc(shadow_status_miss);
     return 0;
-}
-
-static inline unsigned long __shadow_status(
-    struct domain *d, unsigned long gpfn, unsigned long stype)
-{
-    unsigned long mfn = ((current->domain == d)
-                          ? gmfn_to_mfn(d, gpfn)
-                          : INVALID_MFN);
-
-    ASSERT(shadow_lock_is_acquired(d));
-    ASSERT(gpfn == (gpfn & PGT_mfn_mask));
-    ASSERT(stype && !(stype & ~PGT_type_mask));
-
-    if ( VALID_MFN(mfn) && mfn_valid(mfn) &&
-         (stype != PGT_writable_pred) &&
-         ((stype == PGT_snapshot)
-          ? !mfn_out_of_sync(mfn)
-          : !mfn_is_page_table(mfn)) )
-    {
-        perfc_incrc(shadow_status_shortcut);
-#ifndef NDEBUG
-        if ( ___shadow_status(d, gpfn, stype) != 0 )
-        {
-            printk("d->id=%d gpfn=%lx mfn=%lx stype=%lx c=%x t=%" PRtype_info 
" "
-                   "mfn_out_of_sync(mfn)=%d mfn_is_page_table(mfn)=%d\n",
-                   d->domain_id, gpfn, mfn, stype,
-                   mfn_to_page(mfn)->count_info,
-                   mfn_to_page(mfn)->u.inuse.type_info,
-                   mfn_out_of_sync(mfn), mfn_is_page_table(mfn));
-            BUG();
-        }
-
-        // Undo the affects of the above call to ___shadow_status()'s perf
-        // counters, since that call is really just part of an assertion.
-        //
-        perfc_decrc(shadow_status_calls);
-        perfc_decrc(shadow_status_miss);
-#endif
-        return 0;
-    }
-
-    return ___shadow_status(d, gpfn, stype);
 }
 
 /*
diff -r ee9691e23dbe -r 1c69197d29b7 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h      Thu Feb  9 16:42:51 2006
+++ b/xen/include/xen/perfc_defn.h      Thu Feb  9 17:35:15 2006
@@ -86,7 +86,7 @@
 PERFCOUNTER_CPU(unshadow_l2_count,      "unpinned L2 count")
 
 PERFCOUNTER_CPU(shadow_status_shortcut, "fastpath miss on shadow cache")
-PERFCOUNTER_CPU(shadow_status_calls,    "calls to ___shadow_status")
+PERFCOUNTER_CPU(shadow_status_calls,    "calls to shadow_status")
 PERFCOUNTER_CPU(shadow_status_miss,     "missed shadow cache")
 PERFCOUNTER_CPU(shadow_status_hit_head, "hits on head of bucket")
 PERFCOUNTER_CPU(shadow_max_type,        "calls to shadow_max_type")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.