All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen Interdomain Semaphore
@ 2009-03-09 21:25 Timothy Hayes
  2009-03-10  8:21 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Timothy Hayes @ 2009-03-09 21:25 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 758 bytes --]

Hi,

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.

Kind regards
Tim Hayes

[-- Attachment #1.2: Type: text/html, Size: 899 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Xen Interdomain Semaphore
  2009-03-09 21:25 Xen Interdomain Semaphore Timothy Hayes
@ 2009-03-10  8:21 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2009-03-10  8:21 UTC (permalink / raw)
  To: Timothy Hayes, xen-devel

On 09/03/2009 21:25, "Timothy Hayes" <hayesti@tcd.ie> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-10  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-09 21:25 Xen Interdomain Semaphore Timothy Hayes
2009-03-10  8:21 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.