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

[Xen-devel] [PATCH 11/21] xenpaging: optimize p2m_mem_paging_populate


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Fri, 26 Nov 2010 14:49:12 +0100
  • Delivery-date: Fri, 26 Nov 2010 06:00:22 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

p2m_mem_paging_populate will always put another request in the ring.  To
reduce pressure on the ring, place only required requests in the ring.
If the gfn was already processed by another thread, and the current vcpu
does not need to be paused, p2m_mem_paging_resume will do nothing with
the request.  And also xenpaging will drop the request if the vcpu does
not need a wakeup.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 xen/arch/x86/mm/p2m.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- xen-unstable.hg-4.1.22433.orig/xen/arch/x86/mm/p2m.c
+++ xen-unstable.hg-4.1.22433/xen/arch/x86/mm/p2m.c
@@ -2757,12 +2757,12 @@ void p2m_mem_paging_populate(struct p2m_
     p2m_type_t p2mt;
     struct domain *d = p2m->domain;
 
-    memset(&req, 0, sizeof(req));
-
     /* Check that there's space on the ring for this request */
     if ( mem_event_check_ring(d) )
         return;
 
+    memset(&req, 0, sizeof(req));
+
     /* Fix p2m mapping */
     /* XXX: It seems inefficient to have this here, as it's only needed
      *      in one case (ept guest accessing paging out page) */
@@ -2781,6 +2781,11 @@ void p2m_mem_paging_populate(struct p2m_
         vcpu_pause_nosync(v);
         req.flags |= MEM_EVENT_FLAG_VCPU_PAUSED;
     }
+    else if ( p2mt != p2m_ram_paging_out && p2mt != p2m_ram_paged )
+    {
+        /* gfn is already on its way back and vcpu is not paused */
+        return;
+    }
 
     /* Send request to pager */
     req.gfn = gfn;


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


 


Rackspace

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