xfs
[Top] [All Lists]

Re: xfs_file_splice_read: possible circular locking dependency detected

To: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: xfs_file_splice_read: possible circular locking dependency detected
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Sep 2016 22:23:42 +0100
Cc: CAI Qian <caiqian@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160908204450.GJ2356@xxxxxxxxxxxxxxxxxx>
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> <20160908204450.GJ2356@xxxxxxxxxxxxxxxxxx>
Sender: Al Viro <viro@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.7.0 (2016-08-17)
On Thu, Sep 08, 2016 at 09:44:50PM +0100, Al Viro wrote:

> Moreover, I don't see why we need to hold pipe lock the actual call of
> ->read_iter().  Right now we only grab it for "feed into pipe buffers"
> part.  Objections?

Actually, screw the "array of bvec"; we'd need to mark the ones that are
pagecache-backed somehow to tell which methods should be used.  Let's
add a variant of iov_iter that would be backed by pipe_buffer array;
copy_page_to_iter() fills the next slot with an extra reference to the
page we'd been given and using page_cache_pipe_buf_ops for ->ops.
copy_to_iter() adds to the last slot if it has default_pipe_buf_ops for
->ops and still has space in it or allocates a new page, sticks into the
next slot, copies data into it and sets default_pipe_ops for ->ops.

Then all we need is a variant of splice_to_pipe()/splice_{grow,shrink}_spd()
that would work with an array of pipe_buffer instead of page/partial_page
array pair.

<Prev in Thread] Current Thread [Next in Thread>