Skip to contentSkip to conversation

Xen Interdomain Semaphore

DISCUSSION Timothy Hayes 2 participants 2 messages Mar 9, 2009 – Mar 10, 2009

lore
Share & tools
lore
#0 lore raw

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 11 lines · Timothy Hayes

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