| To: | Al Viro <viro@xxxxxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: xfs_file_splice_read: possible circular locking dependency detected |
| From: | Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> |
| Date: | Thu, 8 Sep 2016 11:18:45 -0700 |
| Cc: | CAI Qian <caiqian@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+MdE25vQvO5vhNQty7X2/d38ILSzGvxTu4wY8MGR67o=; b=kgbsPIV3AtZB85eTiigRq1hD3jg6gEbDgclcI5wLQNCMji+N2x2tumdlTIriiBJMKo 8mm4B/vvAjqlVg8UrlO+Ztz/yELEqTZM5/gX6POakvW3IY1CrOnH59wjwE+WmnETUgG0 Vi0HW18XKTzo9EcdqGpwrT51/kMYQe+3kvJWBDcT9zxO1wAvueQMnslzdK34QXFazi/U cJIWS0y46eLNndRcW0UmGDzfPAapEuNJCj1ZWmBIzAt8iWiabf3TgNycaKi4I5UxStYU rf+UcLVJCDy7NDYn1zG0BwL04lIIC8tpMjRb1e/cH4AQVXpKYSeJKZ9IgKFisvyu4TE7 zgxA== |
| In-reply-to: | <CA+55aFzg+Q0DzFNBR9TeL13_yfrfFwHu9OrZe--Zpje0EeN4Cw@xxxxxxxxxxxxxx> |
| References: | <723420070.1340881.1472835555274.JavaMail.zimbra@xxxxxxxxxx> <1832555471.1341372.1472835736236.JavaMail.zimbra@xxxxxxxxxx> <20160903003919.GI30056@dastard> <1450936953.949798.1473348551588.JavaMail.zimbra@xxxxxxxxxx> <20160908175632.GH2356@xxxxxxxxxxxxxxxxxx> <CA+55aFzg+Q0DzFNBR9TeL13_yfrfFwHu9OrZe--Zpje0EeN4Cw@xxxxxxxxxxxxxx> |
| Sender: | linus971@xxxxxxxxx |
On Thu, Sep 8, 2016 at 11:12 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> So the problem really is that the vfs layer seems to simply not allow
> the filesystem to do any locking around the generic page cache helper
> functions. And XFS really wants to do that.
Hmm.
I wonder if we could just take the pipe lock *much* earlier at the
splice() layer? Do it before any callbacks to the low-level
filesystems, not inside the "generic" splice helpers at all?
That would clean up a ton of crap.
The *one* reason that seems impossible right now seems to be that we
use "pipe_wait()" in our splice ops. And "pipe_wait()" drops and
retakes the pipe lock over the waiting.
BUT.
What if we got rid of all the pipe-wait crap entirely, and just made
all the splice routines return EAGAIN instead of waiting? And then do
the pipe_wait() at the higher level, outside the filesystem callback
code, and outside the low-level generic helpers?
Maybe that pipe_wait() movement doesn't really work for some reason
that I didn't look at, but that would really help make the locking
enormously simpler. And then the pipe lock would *obviously* be the
outermost lock, and we'd get rid of all the issues with filesystem
lock ordering.
Linus
|
| Previous by Date: | Re: xfs_file_splice_read: possible circular locking dependency detected, Linus Torvalds |
|---|---|
| Next by Date: | Re: [PATCH 07/71] xfs: define tracepoints for refcount btree activities, Darrick J. Wong |
| Previous by Thread: | Re: xfs_file_splice_read: possible circular locking dependency detected, Linus Torvalds |
| Next by Thread: | Re: xfs_file_splice_read: possible circular locking dependency detected, Al Viro |
| Indexes: | [Date] [Thread] [Top] [All Lists] |