WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 08/17] xenpaging: make vcpu_sleep_nosync() optional i

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 08/17] xenpaging: make vcpu_sleep_nosync() optional in mem_event_check_ring()
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 06 Dec 2010 21:59:15 +0100
Delivery-date: Mon, 06 Dec 2010 13:14:49 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1291669159; l=2549; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=rPbjmibb3gnOL60YGoNA9jyKKY8=; b=EYombdRCKx4JbMYtExq32qr5FqwpeEFfxcMRELzbycWHAJ6bYD2sjWtF1bwZQTFtXXt PeQNGClXj2gYJBnRfQiZKVJtepFTP1O491uYcjVcMqs3EdkJ8b2woyDHCFkqE7/dAYCRA srO7dsqHhRgQyM7902cOFmZsD7O8OepiH0Y=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20101206205907.848643876@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-4.4
Add a new option to mem_event_check_ring() to disable the
vcpu_sleep_nosync. This is needed for an upcoming patch which sends a
one-way request to the pager.

Also add a micro-optimization, check ring_full first because its value
was just evaluated.

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

---
 xen/arch/x86/mm/mem_event.c     |    4 ++--
 xen/arch/x86/mm/mem_sharing.c   |    2 +-
 xen/arch/x86/mm/p2m.c           |    2 +-
 xen/include/asm-x86/mem_event.h |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

--- xen-unstable.hg-4.1.22459.orig/xen/arch/x86/mm/mem_event.c
+++ xen-unstable.hg-4.1.22459/xen/arch/x86/mm/mem_event.c
@@ -143,7 +143,7 @@ void mem_event_unpause_vcpus(struct doma
             vcpu_wake(v);
 }
 
-int mem_event_check_ring(struct domain *d)
+int mem_event_check_ring(struct domain *d, int do_vcpu_sleep)
 {
     struct vcpu *curr = current;
     int free_requests;
@@ -159,7 +159,7 @@ int mem_event_check_ring(struct domain *
     }
     ring_full = free_requests < MEM_EVENT_RING_THRESHOLD;
 
-    if ( (curr->domain->domain_id == d->domain_id) && ring_full )
+    if ( ring_full && do_vcpu_sleep && (curr->domain->domain_id == 
d->domain_id) )
     {
         set_bit(_VPF_mem_event, &curr->pause_flags);
         vcpu_sleep_nosync(curr);
--- xen-unstable.hg-4.1.22459.orig/xen/arch/x86/mm/mem_sharing.c
+++ xen-unstable.hg-4.1.22459/xen/arch/x86/mm/mem_sharing.c
@@ -321,7 +321,7 @@ static struct page_info* mem_sharing_all
     }
         
     /* XXX: Need to reserve a request, not just check the ring! */
-    if(mem_event_check_ring(d)) return page;
+    if(mem_event_check_ring(d, 1)) return page;
 
     req.flags |= MEM_EVENT_FLAG_OUT_OF_MEM;
     req.gfn = gfn;
--- xen-unstable.hg-4.1.22459.orig/xen/arch/x86/mm/p2m.c
+++ xen-unstable.hg-4.1.22459/xen/arch/x86/mm/p2m.c
@@ -2758,7 +2758,7 @@ void p2m_mem_paging_populate(struct p2m_
     struct domain *d = p2m->domain;
 
     /* Check that there's space on the ring for this request */
-    if ( mem_event_check_ring(d) )
+    if ( mem_event_check_ring(d, 1) )
         return;
 
     memset(&req, 0, sizeof(req));
--- xen-unstable.hg-4.1.22459.orig/xen/include/asm-x86/mem_event.h
+++ xen-unstable.hg-4.1.22459/xen/include/asm-x86/mem_event.h
@@ -24,7 +24,7 @@
 #ifndef __MEM_EVENT_H__
 #define __MEM_EVENT_H__
 
-int mem_event_check_ring(struct domain *d);
+int mem_event_check_ring(struct domain *d, int do_vcpu_sleep);
 void mem_event_put_request(struct domain *d, mem_event_request_t *req);
 void mem_event_get_response(struct domain *d, mem_event_response_t *rsp);
 void mem_event_unpause_vcpus(struct domain *d);


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

<Prev in Thread] Current Thread [Next in Thread>