linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] Set the lockdep class on eb's at allocation time
@ 2020-10-30 21:02 Josef Bacik
  2020-10-30 21:02 ` [PATCH 01/14] btrfs: remove lockdep classes for the fs tree Josef Bacik
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Josef Bacik @ 2020-10-30 21:02 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Hello,

We've had a lockdep splat show up a few times recently where the extent buffer
doesn't have it's lockdep class set properly.  This can happen if you have
concurrent readers hitting the same block that's not in cache.

This is sort of straightforward to fix, but unfortunately requires quite a bit
of code churn to do it cleanly.  The bulck of these patches are replacing open
coded calls of btrfs_read_node_slot() with the helper to cut down on the number
of people directly calling read_tree_block().  I also cleaned up the readahead
helpers because passing all these arguments around would be unweildy.  The last
patch in the series is the actual fix for what Filipe and Fedora QA saw.

The patches that actually have meaningful changes are

  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: set the lockdep class for ebs on creation

The rest are cleanups or adding arguments to various functions, so aren't too
tricky.  I've put this through a quick xfstest run for sanity sake, it didn't
appear to break anything, but the full run is still going.  Thanks,

Josef

Josef Bacik (14):
  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: use btrfs_read_node_slot in btrfs_realloc_node
  btrfs: use btrfs_read_node_slot in walk_down_reloc_tree
  btrfs: use btrfs_read_node_slot in do_relocation
  btrfs: use btrfs_read_node_slot in replace_path
  btrfs: use btrfs_read_node_slot in walk_down_tree
  btrfs: use btrfs_read_node_slot in qgroup_trace_extent_swap
  btrfs: use btrfs_read_node_slot in qgroup_trace_new_subtree_blocks
  btrfs: use btrfs_read_node_slot in btrfs_qgroup_trace_subtree
  btrfs: pass root owner to read_tree_block
  btrfs: pass the root owner and level around for reada
  btrfs: pass the owner_root and level to alloc_extent_buffer
  btrfs: set the lockdep class for ebs on creation

 fs/btrfs/backref.c     |  6 +--
 fs/btrfs/ctree.c       | 86 +++++++++---------------------------------
 fs/btrfs/disk-io.c     | 41 +++++++-------------
 fs/btrfs/disk-io.h     |  8 ++--
 fs/btrfs/extent-tree.c | 20 ++++++----
 fs/btrfs/extent_io.c   | 55 ++++++++++++++++++++++++++-
 fs/btrfs/extent_io.h   |  6 ++-
 fs/btrfs/print-tree.c  |  1 +
 fs/btrfs/qgroup.c      | 43 ++++-----------------
 fs/btrfs/reada.c       | 32 +++++++++++-----
 fs/btrfs/ref-verify.c  | 18 +--------
 fs/btrfs/relocation.c  | 45 +++++-----------------
 fs/btrfs/tree-log.c    |  4 +-
 fs/btrfs/volumes.c     | 12 ++----
 14 files changed, 157 insertions(+), 220 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 00/14][REBASED] Set the lockdep class on eb's at allocation time
@ 2020-11-05 15:45 Josef Bacik
  2020-11-05 15:45 ` [PATCH 06/14] btrfs: use btrfs_read_node_slot in replace_path Josef Bacik
  0 siblings, 1 reply; 17+ messages in thread
From: Josef Bacik @ 2020-11-05 15:45 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

- no change, simply rebased onto the lastest misc-next

Hello,

We've had a lockdep splat show up a few times recently where the extent buffer
doesn't have it's lockdep class set properly.  This can happen if you have
concurrent readers hitting the same block that's not in cache.

This is sort of straightforward to fix, but unfortunately requires quite a bit
of code churn to do it cleanly.  The bulck of these patches are replacing open
coded calls of btrfs_read_node_slot() with the helper to cut down on the number
of people directly calling read_tree_block().  I also cleaned up the readahead
helpers because passing all these arguments around would be unweildy.  The last
patch in the series is the actual fix for what Filipe and Fedora QA saw.

The patches that actually have meaningful changes are

  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: set the lockdep class for ebs on creation

The rest are cleanups or adding arguments to various functions, so aren't too
tricky.  I've put this through a quick xfstest run for sanity sake, it didn't
appear to break anything, but the full run is still going.  Thanks,

Josef

Josef Bacik (14):
  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: use btrfs_read_node_slot in btrfs_realloc_node
  btrfs: use btrfs_read_node_slot in walk_down_reloc_tree
  btrfs: use btrfs_read_node_slot in do_relocation
  btrfs: use btrfs_read_node_slot in replace_path
  btrfs: use btrfs_read_node_slot in walk_down_tree
  btrfs: use btrfs_read_node_slot in qgroup_trace_extent_swap
  btrfs: use btrfs_read_node_slot in qgroup_trace_new_subtree_blocks
  btrfs: use btrfs_read_node_slot in btrfs_qgroup_trace_subtree
  btrfs: pass root owner to read_tree_block
  btrfs: pass the root owner and level around for reada
  btrfs: pass the owner_root and level to alloc_extent_buffer
  btrfs: set the lockdep class for ebs on creation

 fs/btrfs/backref.c     |  6 +--
 fs/btrfs/ctree.c       | 86 +++++++++---------------------------------
 fs/btrfs/disk-io.c     | 41 +++++++-------------
 fs/btrfs/disk-io.h     |  8 ++--
 fs/btrfs/extent-tree.c | 20 ++++++----
 fs/btrfs/extent_io.c   | 55 ++++++++++++++++++++++++++-
 fs/btrfs/extent_io.h   |  6 ++-
 fs/btrfs/print-tree.c  |  1 +
 fs/btrfs/qgroup.c      | 43 ++++-----------------
 fs/btrfs/reada.c       | 32 +++++++++++-----
 fs/btrfs/ref-verify.c  | 18 +--------
 fs/btrfs/relocation.c  | 45 +++++-----------------
 fs/btrfs/tree-log.c    |  4 +-
 fs/btrfs/volumes.c     | 12 ++----
 14 files changed, 157 insertions(+), 220 deletions(-)

-- 
2.26.2


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

end of thread, other threads:[~2020-11-06 11:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 21:02 [PATCH 00/14] Set the lockdep class on eb's at allocation time Josef Bacik
2020-10-30 21:02 ` [PATCH 01/14] btrfs: remove lockdep classes for the fs tree Josef Bacik
2020-10-30 21:02 ` [PATCH 02/14] btrfs: cleanup extent buffer readahead Josef Bacik
2020-10-30 21:02 ` [PATCH 03/14] btrfs: use btrfs_read_node_slot in btrfs_realloc_node Josef Bacik
2020-10-30 21:02 ` [PATCH 04/14] btrfs: use btrfs_read_node_slot in walk_down_reloc_tree Josef Bacik
2020-10-30 21:02 ` [PATCH 05/14] btrfs: use btrfs_read_node_slot in do_relocation Josef Bacik
2020-10-30 21:02 ` [PATCH 06/14] btrfs: use btrfs_read_node_slot in replace_path Josef Bacik
2020-10-30 21:02 ` [PATCH 07/14] btrfs: use btrfs_read_node_slot in walk_down_tree Josef Bacik
2020-10-30 21:03 ` [PATCH 08/14] btrfs: use btrfs_read_node_slot in qgroup_trace_extent_swap Josef Bacik
2020-10-30 21:03 ` [PATCH 09/14] btrfs: use btrfs_read_node_slot in qgroup_trace_new_subtree_blocks Josef Bacik
2020-10-30 21:03 ` [PATCH 10/14] btrfs: use btrfs_read_node_slot in btrfs_qgroup_trace_subtree Josef Bacik
2020-10-30 21:03 ` [PATCH 11/14] btrfs: pass root owner to read_tree_block Josef Bacik
2020-10-30 21:03 ` [PATCH 12/14] btrfs: pass the root owner and level around for reada Josef Bacik
2020-10-30 21:03 ` [PATCH 13/14] btrfs: pass the owner_root and level to alloc_extent_buffer Josef Bacik
2020-10-30 21:03 ` [PATCH 14/14] btrfs: set the lockdep class for ebs on creation Josef Bacik
2020-11-05 15:45 [PATCH 00/14][REBASED] Set the lockdep class on eb's at allocation time Josef Bacik
2020-11-05 15:45 ` [PATCH 06/14] btrfs: use btrfs_read_node_slot in replace_path Josef Bacik
2020-11-06 11:53   ` Filipe Manana

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).