From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] libxenstore: Use poll() with a non-blocking read() Date: Tue, 18 Aug 2015 10:48:34 +0100 Message-ID: <55D2FF72.7050006@citrix.com> References: <1439502287-5520-1-git-send-email-jonathan.creekmore@gmail.com> <1439715572.3480.19.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZRdVc-0002lL-9f for xen-devel@lists.xenproject.org; Tue, 18 Aug 2015 09:48:44 +0000 In-Reply-To: <1439715572.3480.19.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Jonathan Creekmore , xen-devel@lists.xenproject.org, Konrad Rzeszutek Wilk , BorisOstrovsky Cc: ian.jackson@eu.citrix.com, wei.liu@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 /proc/xen/xenbus. > 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. David