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

Re: [Xen-devel] Re: how to handle paged hypercall args?

To: Keir Fraser <keir@xxxxxxx>
Subject: Re: [Xen-devel] Re: how to handle paged hypercall args?
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 3 Dec 2010 10:14:30 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Fri, 03 Dec 2010 01:15:36 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1291367680; l=1383; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=Qi3Cxwniavu50H/nicGrpFV475w=; b=fT6aVo+1m7BtH+V1APIszR0ux+gIW9Sp9pQ3NgaKJLbxD810joFbcQEB0hez3bXpj+k R11BEJacA7guLLWFagcRNQVGfdMIZBVQ8+Sb2ikdLD1iMdylJ3IUF7aIwQt7YMVWN8bCu NGh0T1p9YWAKUhAcGOTVrm5/KKn6NU1wxdA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C91D25CA.BB1B%keir@xxxxxxx>
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: <C91D2401.BB08%keir@xxxxxxx> <C91D25CA.BB1B%keir@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Dec 02, Keir Fraser wrote:

> On 02/12/2010 10:22, "Keir Fraser" <keir@xxxxxxx> wrote:
> 
> > Firstly, the usage of waitqueues is broken. The waitqueue_head should be
> > shared with code that pages in, so that vcpus can be *woken* at some point
> > after they start waiting. As it is, if a vcpu does sleep on its local
> > waitqueue_head, it will never wake. You might start with a single global
> > waitqueue_head and wake everyone on it every time a page (or maybe page
> > batch) is paged in. More sophisticated might be to hash page numbers into a
> > array of waitqueue_heads, to reduce false wakeups.
> 
> ...Or you might have a per-domain waitqueue_head, and do the wake_up() from
> code that adds paged-in entries to the guest physmap. That would seem a
> pretty sensible way to proceed, to me.

Thats what I'm doing right now.

It seems that the existing MEM_EVENT_FLAG_VCPU_PAUSED code can be reused
for this. I was messing with wait_event() until I realized that the vcpu
is stopped by p2m_mem_paging_populate() already and the wake_up() ran
before the vcpu got a chance to call schedule().

If a vcpu happens to be scheduled and the domain is destroyed, the
BUG_ON in destroy_waitqueue_vcpu() will trigger. What can happen if
there is still an entry in the list? The cleanup should handle this
situation to not crash Xen itself.

Olaf


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