public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs: kill lockdep false positives from readdir
@ 2015-08-11 22:04 Dave Chinner
  2015-08-11 22:04 ` [PATCH 1/2] xfs: clean up inode lockdep annotations Dave Chinner
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Dave Chinner @ 2015-08-11 22:04 UTC (permalink / raw)
  To: xfs; +Cc: jack, oleg

Hi Folks,

These two patches change the XFS directory locking to shut up
lockdep. Ever since we changed the locking to serialise readdir via
the ILOCK for CXFS, lockdep has been producing false positive
warnings because filldir can trigger page faults and lockdep can't
be easily told that you can't take page faults on directory inodes
so it warns about all sorts of stuff that just can't deadlock.

To fix this, we need to change the directory locking (again!)
to use a different structure that separates the page fault path out
from underneath the ILOCK. TO do this, we have to treat the
directory data the same way we treat file data: The IOLOCK
serialises access to the data sections of the inode, the ILOCK
serialises access to the metadata sections of the inode.

This means that we need to take the IOLOCK in operations that modify
the directory data, which means we need nested PARENT lockdep
annotations because we need to lock two inodes at a time, so the
inode subclass lockdep annotations need a complete rework to support
this. This annotation rework is the first patch in the series.

THe second patch in the series is the directory locking rework. It's
all relatively straight forward - on modification the IOLOCK is
taken EXCL before we start transactions, the transaction join is modified
to understand the IOLOCK is also held, and the transaction commit
releases the IOLOCK. On readdir, we hold the IOLOCK in SHARED mode
across the readdir operation, and only hold the ILOCK when doing
operations that walk the extent tree and map directory buffers.

Oleg and Jan, this patchset should fix the lockdep issues that have
been seen with the freeze rework. Oleg, can you you try it with your
current patchset and testing and let me know if there are any issues
that you see?

Cheers,

Dave.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-15 22:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 22:04 [PATCH 0/2] xfs: kill lockdep false positives from readdir Dave Chinner
2015-08-11 22:04 ` [PATCH 1/2] xfs: clean up inode lockdep annotations Dave Chinner
2015-08-14 19:41   ` Brian Foster
2015-08-11 22:04 ` [PATCH 2/2] xfs: stop holding ILOCK over filldir callbacks Dave Chinner
2015-08-14 19:41   ` Brian Foster
2015-08-14 22:39     ` Dave Chinner
2015-08-15 13:01       ` Brian Foster
2015-08-15 22:56         ` Dave Chinner
2015-08-12 11:42 ` [PATCH 0/2] xfs: kill lockdep false positives from readdir Oleg Nesterov
2015-08-12 11:43 ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox