From: Christoph Hellwig <hch@lst.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>, xfs@oss.sgi.com
Subject: Re: [PATCH, RFC] xfs: remove i_iolock and use i_rwsem in the VFS inode instead
Date: Fri, 9 Sep 2016 11:05:44 +0200 [thread overview]
Message-ID: <20160909090544.GA21779@lst.de> (raw)
In-Reply-To: <20160909084450.GF10153@twins.programming.kicks-ass.net>
On Fri, Sep 09, 2016 at 10:44:50AM +0200, Peter Zijlstra wrote:
> Do tell; note however that due to the strict write owner, we can do
> things like the optimistic spinning which improved writer->writer
> performance significantly.
>
> Also note that !owner locks create problems for RT.
Your clearly missed out on our little Linux-RT conference in June :)
While I basically agree with you there is an important class of problems
that warrant a non-owner release, and that is I/O. The easiest example
(which also happens to be somewhat relevant for this thread) is the
XFS iolock (or i_rwsem for that matter). We need to hold this over
file writes, but for direct I/O those always go out to disk. In the
AIO case there simply is no owner left once control is handed off
to the disk / controller and we'll only be able to unlock once we
get a completion. Currenrly we work around that using i_dio_count
and a hashed waitqueue, but in many ways that solution is worse than
the problem (and I say that as the person that introduced it!).
We have many many similar issues all over the tree, and people are
"fixing" it using home grown lock primitives like the one above
or using bitlocks (see the recent thread on cross-release semantics
for those). I think everyone would be better server by accepting
that this case exists and finding a place for it in the framework.
E.g. for RT trying to boost something that is fully under control
of hardware is pointless, but if we have a way to transfer a lock
from an owner to a hardware owned state we could at least boost
until that handoff happened.
None of that is really relevant for this thread though - no cross
release involved in the case that's tripping up lockdep here, just
lock "borrowing" using a synchronous work item. The real root cause
here is the too small kernel stack that led to this workqueue.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-09-09 9:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 17:10 [PATCH, RFC] xfs: remove i_iolock and use i_rwsem in the VFS inode instead Christoph Hellwig
2016-08-11 21:54 ` Peter Zijlstra
2016-08-18 17:37 ` Christoph Hellwig
2016-08-19 13:27 ` Peter Zijlstra
2016-08-20 6:37 ` Christoph Hellwig
2016-08-22 8:34 ` Peter Zijlstra
2016-09-05 15:12 ` Christoph Hellwig
2016-09-07 7:43 ` Peter Zijlstra
2016-09-08 6:06 ` Ingo Molnar
2016-08-11 23:43 ` Dave Chinner
2016-08-12 2:50 ` Christoph Hellwig
2016-08-12 9:58 ` Dave Chinner
2016-09-05 15:15 ` Christoph Hellwig
2016-09-07 21:45 ` Dave Chinner
2016-09-08 6:54 ` Peter Zijlstra
2016-09-09 1:06 ` Dave Chinner
2016-09-09 8:21 ` Peter Zijlstra
2016-09-09 8:34 ` Christoph Hellwig
2016-09-11 0:17 ` Dave Chinner
2016-09-13 19:42 ` Peter Zijlstra
2016-09-09 8:33 ` Christoph Hellwig
2016-09-09 8:44 ` Peter Zijlstra
2016-09-09 9:05 ` Christoph Hellwig [this message]
2016-09-09 9:51 ` Peter Zijlstra
2016-09-10 16:20 ` Christoph Hellwig
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=20160909090544.GA21779@lst.de \
--to=hch@lst.de \
--cc=peterz@infradead.org \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).