From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Vitaly Chernooky <vitalii.chernookyi@globallogic.com>
Cc: Iurii Konovalenko <iurii.konovalenko@globallogic.com>,
Ian Campbell <ian.campbell@citrix.com>,
xen-devel <xen-devel@lists.xen.org>,
Embedded-pv-devel@lists.xenproject.org,
David Vrabel <david.vrabel@citrix.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: Deadlock in /proc/xen/xenbus watch+read on 3.17+ (maybe earlier)
Date: Fri, 20 Mar 2015 11:41:52 +0100 [thread overview]
Message-ID: <20150320104152.GB2321@mail-itl> (raw)
In-Reply-To: <CANZZXhDv7S-tXqsmSkC29qhkDm-35DoLKP3UENJT7KXXoD8o1Q@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3031 bytes --]
On Fri, Mar 20, 2015 at 12:08:48PM +0200, Vitaly Chernooky wrote:
> On Fri, Mar 20, 2015 at 6:04 AM, Marek Marczykowski-Górecki <
> marmarek@invisiblethingslab.com> wrote:
>
> > On Thu, Mar 19, 2015 at 03:10:49PM +0200, Vitaly Chernooky wrote:
> > > David,
> > >
> > > On Thu, Mar 19, 2015 at 3:00 PM, David Vrabel <david.vrabel@citrix.com>
> > > wrote:
> > >
> > > > On 19/03/15 12:10, Iurii Konovalenko wrote:
> > > > > Hi, guys!
> > > > >
> > > > > When I read, that I am not alone and that issue depends on kernel
> > > > > version, I decided to continue investigation.
> > > > > And I found why our threads locks on read/write operations.
> > > > > On Linux kernel 3.14+ syscalls of file read and write changed a bit:
> > > > > fdget() function was replaced by fdget_pos() - it is fdget() function
> > > > > plus additional position mutex lock for files with FMODE_ATOMIC_POS
> > > > > (files for inodes with S_IFREG flag set - regular nodes). As I
> > thought
> > > > > our xen files are not regular and nonseekable, I hoped this flag is
> > > > > not set. But it is set. It is because our file system is created by
> > > > > function simple_fill_super(), and inside it this flag is hardly set:
> > > > > inode->i_mode = S_IFREG | files->mode;
> > > > > So, as a fast hack I made a patch: just made copy of this function
> > for
> > > > > xen, which does not set this flag. It works for me. Could you please
> > > > > check if it works for you.
> > > >
> > > > I still can't get this to deadlock, but why not clear FMODE_ATOMIC_POS
> > > > in xenbus_file_open() ?
> > > >
> > >
> > > Because it is not the root of issue. FMODE_ATOMIC_POS is just one of
> > > results of bug. Iurii has fixed the root of issue but in suboptimal way.
> > So
> > > we just need to have found optimal way.
> >
> > I can just confirm that:
> > 1. (unsurprisingly) the bug is still present in 4.0-rc4
> > 2. both proposed fixes are effective
> >
> > I'm not sure if removing S_IFREG completely is a good idea, I guess
> > there will be much more side effects...
> > What about another idea: xenbus_file_open uses nonseekable_open - this
> > looks like a good place to clear FMODE_ATOMIC_POS if present? It
> > doesn't make sense to get a lock for position on nonseekable file,
> > right?
> >
>
> The Open Group Base Specifications Issue 7 IEEE Std 1003.1, 2013 Edition
> requires from regular files to be seekable. But Linux kernel looks like
> Linus has own opinion on it :(((
Maybe the better idea would be to change filetype of xenbus (and others)
to S_IFIFO or something like this (but keep the file type present,
instead of removing it completely).
Regarding the implementation, maybe simple_fill_super can be modified to
not add S_IFREG if other file type is already present in files->mode?
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-03-20 10:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 1:19 Deadlock in /proc/xen/xenbus watch+read on 3.17+ (maybe earlier) Marek Marczykowski-Górecki
2015-03-19 10:38 ` Ian Campbell
2015-03-19 12:10 ` Iurii Konovalenko
2015-03-19 12:32 ` [Embedded-pv-devel] " Vitaly Chernooky
2015-03-19 13:00 ` David Vrabel
2015-03-19 13:10 ` Vitaly Chernooky
2015-03-20 4:04 ` Marek Marczykowski-Górecki
2015-03-20 9:58 ` Vitaly Chernooky
2015-03-20 10:08 ` Vitaly Chernooky
2015-03-20 10:38 ` Vitaly Chernooky
2015-03-20 10:46 ` David Vrabel
2015-03-20 11:39 ` Vitaly Chernooky
2015-03-20 10:41 ` Marek Marczykowski-Górecki [this message]
2015-03-19 11:10 ` David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150320104152.GB2321@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=Embedded-pv-devel@lists.xenproject.org \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=iurii.konovalenko@globallogic.com \
--cc=vitalii.chernookyi@globallogic.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.