btrfs: Annotate wait events with lockdep
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest7 patches 2 repliesIn review
- v36 patches 3 repliesSuperseded
- v25 patches 11 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 2 patches | 9 replies | Superseded |
Changes in v4 from the cover letter
1) Put the lockdep annotation macros in a separate patch and explaned in more detail how the annotations work in the changelog. Also made small changes to the changelogs of the rest of the patches accordingly (suggested by Sweet Tea Dorminy).
2) Fixed the build warning related to the change of the lockdep class of struct inode's mapping->invalidate_lock.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | btrfs: Add macros for annotating wait events with lockdepfs/ | +45 | 1 reply | |
| 2/7 | btrfs: Add a lockdep annotation for the num_writers wait eventfs/ fs/ fs/ | +36 | 0 replies | |
| 3/7 | btrfs: Add a lockdep annotation for the num_extwriters wait eventfs/ fs/ fs/ | +15 | 0 replies | |
| 4/7 | btrfs: Add lockdep annotations for the transaction states wait eventsfs/ fs/ fs/ | +89 | 0 replies | |
| 5/7 | btrfs: Add a lockdep annotation for the pending_ordered wait eventfs/ fs/ fs/ +1 more | +6 | 0 replies | |
| 6/7 | btrfs: Change the lockdep class of struct inode's invalidate_lockfs/ | +10 | 0 replies | |
| 7/7 | btrfs: Add a lockdep annotation for the ordered extents wait eventfs/ fs/ fs/ +1 more | +33 | 0 replies |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Josef Bacik |
|---|---|
| 1/7 | R-b |
| 2/7 | R-b |
| 3/7 | R-b |
| 4/7 | R-b |
| 5/7 | R-b |
| 6/7 | R-b |
| 7/7 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/7] btrfs: Annotate wait events with lockdep
Hello,
With this patch series we annotate wait events in btrfs with lockdep to catch deadlocks involving these wait events.
Recently the btrfs developers fixed a non trivial deadlock involving wait events
https://lore.kernel.org/linux-btrfs/[email protected]/
Currently lockdep is unable to catch these deadlocks since it does not support wait events by default.
With our lockdep annotations we train lockdep to track these wait events and catch more potential deadlocks.
Specifically, we annotate the below wait events in fs/btrfs/transaction.c and in fs/btrfs/ordered-data.c:
1) The num_writers wait event
2) The num_extwriters wait event
3) The transaction states wait events
4) The pending_ordered wait event
5) The ordered extents wait event
Changes from v3:
1) Put the lockdep annotation macros in a separate patch and explaned in more detail how the annotations work in the changelog. Also made small changes to the changelogs of the rest of the patches accordingly (suggested by Sweet Tea Dorminy).
2) Fixed the build warning related to the change of the lockdep class of struct inode's mapping->invalidate_lock.
Changes from v2:
1) Added macros to initialize the lockdep maps so that the code is cleaner.
2) Added comments related to the acquisition of the lockdep maps by threads either as readers or writers.
3) Moved the transaction states annotation in wait_for_commit() in fs/btrfs/transaction.c to make the code cleaner.
4) Separated the lockdep class change of invalidate_lock and the ordered extents wait event annotation into 2 patches.
Changes from v1:
1) Added 2 labels in the cleanup code of btrfs_commit_transaction() in fs/btrfs/transaction.c so that btrfs_lockdep_release() is not called multiple times during the error paths.
2) Added lockdep annotations for the btrfs transaction states wait events.
3) Added a lockdep annotation for the pending_ordered wait event.
4) Added a lockdep annotation for the ordered extents wait event.
Ioannis Angelakopoulos (7):
btrfs: Add macros for annotating wait events with lockdep
btrfs: Add a lockdep annotation for the num_writers wait event
btrfs: Add a lockdep annotation for the num_extwriters wait event
btrfs: Add lockdep annotations for the transaction states wait events
btrfs: Add a lockdep annotation for the pending_ordered wait event
btrfs: Change the lockdep class of struct inode's invalidate_lock
btrfs: Add a lockdep annotation for the ordered extents wait event
fs/btrfs/ctree.h | 82 ++++++++++++++++++++++++++++ fs/btrfs/disk-io.c | 13 +++++ fs/btrfs/free-space-cache.c | 10 ++++ fs/btrfs/inode.c | 13 +++++ fs/btrfs/ordered-data.c | 21 +++++++ fs/btrfs/transaction.c | 106 ++++++++++++++++++++++++++++++++---- 6 files changed, 234 insertions(+), 11 deletions(-)
Signature · 1 line
2.30.2