xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Question about sharing spinlock_t among VMs in Xen
@ 2016-06-13 17:43 Meng Xu
  2016-06-13 18:28 ` Boris Ostrovsky
  2016-06-13 22:54 ` Andrew Cooper
  0 siblings, 2 replies; 9+ messages in thread
From: Meng Xu @ 2016-06-13 17:43 UTC (permalink / raw)
  To: xen-devel

Hi,

I have a quick question about using the Linux spin_lock() in Xen
environment to protect some host-wide shared (memory) resource among
VMs.

*** The question is as follows ***
Suppose I have two Linux VMs sharing the same spinlock_t lock (through
the sharing memory) on the same host. Suppose we have one process in
each VM. Each process uses the linux function spin_lock(&lock) [1] to
grab & release the lock.
Will these two processes in the two VMs have race on the shared lock?

My speculation is that it should have the race on the shard lock when
the spin_lock() function in *two VMs* operate on the same lock.

We did some quick experiment on this and we found one VM sometimes see
the soft lockup on the lock. But we want to make sure our
understanding is correct.

We are exploring if we can use the spin_lock to protect the shared
resources among VMs, instead of using the PV drivers. If the
spin_lock() in linux can provide the host-wide atomicity (which will
surprise me, though), that will be great. Otherwise, we probably have
to expose the spin_lock in Xen to the Linux?

[1] http://lxr.free-electrons.com/source/include/linux/spinlock.h#L300

Thank you very much for your time and help in this question!

Best Regards,

Meng

-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

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

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

end of thread, other threads:[~2016-06-15 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 17:43 Question about sharing spinlock_t among VMs in Xen Meng Xu
2016-06-13 18:28 ` Boris Ostrovsky
2016-06-13 20:46   ` Meng Xu
2016-06-13 21:17     ` Boris Ostrovsky
2016-06-14  1:50       ` Meng Xu
2016-06-13 22:54 ` Andrew Cooper
2016-06-14  2:13   ` Meng Xu
2016-06-14 16:01     ` Andrew Cooper
2016-06-15 15:28       ` Meng Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).