[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] libxenstore: Use poll() with a non-blocking read()

On 16/08/15 09:59, Ian Campbell wrote:
> On Thu, 2015-08-13 at 16:44 -0500, Jonathan Creekmore wrote:
>> With the addition of FMODE_ATOMIC_POS in the Linux 3.14 kernel,
>> concurrent blocking file accesses to a single open file descriptor can
>> cause a deadlock trying to grab the file position lock. If a watch has
>> been set up, causing a read_thread to blocking read on the file
>> descriptor, then future writes that would cause the background read to
>> complete will block waiting on the file position lock before they can
>> execute.

I think you should make libxenstore open /dev/xen/xenbus instead.  Since
this is a character device it should work correctly.

It may be necessary to try /dev/xen/xenbus first and fallback to

> This sounds like you are describing a kernel bug. Shouldn't this be
> fixed in the kernel?

/proc/xen/xenbus should never have existed (it's a character device
masquerading as a regular file), but I guess we're stuck with it now.

The correct kernel fix is to make /proc/xen/xenbus a character device
identical to /dev/xen/xenbus or a symlink to /dev/xen/xenbus.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.