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] Xen Interdomain Semaphore

To: Timothy Hayes <hayesti@xxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Xen Interdomain Semaphore
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 10 Mar 2009 08:21:05 +0000
Cc:
Delivery-date: Tue, 10 Mar 2009 01:21:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <f6ed2720903091425qb9044d5xa761d6890e0b87ed@xxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acmg/a72SzMH2xfEQR2oq5JQ7y9iWgAW3jqu
Thread-topic: [Xen-devel] Xen Interdomain Semaphore
User-agent: Microsoft-Entourage/12.15.0.081119
On 09/03/2009 21:25, "Timothy Hayes" <hayesti@xxxxxx> wrote:

> I'm working with some data that's been mapped into two virtual machine address
> spaces (this is kernel module code). Right now if I try to manipulate the data
> there are race conditions so naturally I need a constraint like a mutex or a
> semaphore. I'm not 100% certain, but I'm guessing the Linux kernel semaphore
> isn't going to work as expected since it puts a process to sleep for a wait()
> call and wakes a process up for the signal() call. The domain in question
> won't be the same domain that created the process.
>  
> I'm wondering if there is an interdomain semaphore for Xen; maybe someone has
> written one already? Maybe there are some "best practices" when it comes to
> something like this. Any tips would be really appreciated.

If you already have shared memory between two domains, it would be easy to
implement a spinlock, right? If you want a sleeping semaphore then in
addition you need an inter-domain event channel. You can block on that and
the 'other end' can wake you by pinging you on it.

 -- Keir



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

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