linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: "Michael L. Semon" <mlsemon35@gmail.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: Multi-CPU harmless lockdep on x86 while copying data
Date: Mon, 10 Mar 2014 03:37:16 -0700	[thread overview]
Message-ID: <20140310103716.GA1431@infradead.org> (raw)
In-Reply-To: <20140310025523.GV6851@dastard>

On Mon, Mar 10, 2014 at 01:55:23PM +1100, Dave Chinner wrote:
> Changing the directory code to handle this sort of locking is going
> to require a bit of surgery. However, I can see advantages to moving
> directory data to the same locking strategy as regular file data -
> locking heirarchies are identical, directory ilock hold times are
> much reduced, we don't get lockdep whining about taking page faults
> with the ilock held, etc.
> 
> A quick hack at to demonstrate the high level, initial step of using
> the IOLOCK for readdir serialisation. I've done a little smoke
> testing on it, so it won't die immediately. It should get rid of all
> the nasty lockdep issues, but it doesn't start to address the deeper
> restructing that is needed.

What synchronization do we actually need from the iolock?  Pushing the
ilock down to where it's actually needed is a good idea either way,
though.

> This would be a straight forward change, except for two things:
> filestreams and lockdep. The filestream allocator takes the
> directory iolock and makes assumptions about parent->child locking
> order of the iolock which will now be invalidated. Hence some
> changes to the filestreams code is needed to ensure that it never
> blocks on directory iolocks and deadlocks. instead it needs to fail
> stream associations when such problems occur.

I think the right fix is to stop abusing the iolock in filestreams.
To me it seems like a look inside fstrm_item_t should be fine
for what the filestreams code wants if I understand it correctly.

>From looking over some of the filestreams code just for a few minutes
I get an urge to redo lots of it right now..

> @@ -1228,7 +1244,7 @@ xfs_create(
>  	 * the transaction cancel unlocking dp so don't do it explicitly in the
>  	 * error path.
>  	 */
> -	xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL);
> +	xfs_trans_ijoin(tp, dp, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);

What do we need the iolock on these operations for?

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-03-10 10:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-09  2:58 Multi-CPU harmless lockdep on x86 while copying data Michael L. Semon
2014-03-10  2:55 ` Dave Chinner
2014-03-10 10:37   ` Christoph Hellwig [this message]
2014-03-10 11:12     ` Christoph Hellwig
2014-03-10 20:51       ` Dave Chinner
2014-03-11 16:48         ` Christoph Hellwig
2014-03-10 20:46     ` Dave Chinner
2014-03-10 21:16       ` Ben Myers
2014-03-10 21:24         ` Dave Chinner
2014-03-10 22:10           ` Ben Myers
2014-03-10 20:52   ` Ben Myers
2014-03-10 21:20     ` Dave Chinner
2014-03-10 21:30       ` Ben Myers

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=20140310103716.GA1431@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --cc=mlsemon35@gmail.com \
    --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).