linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] Make pinned extents tracking per-transaction
@ 2020-01-20 14:09 Nikolay Borisov
  2020-01-20 14:09 ` [PATCH 01/11] btrfs: Perform pinned cleanup directly in btrfs_destroy_delayed_refs Nikolay Borisov
                   ` (11 more replies)
  0 siblings, 12 replies; 39+ messages in thread
From: Nikolay Borisov @ 2020-01-20 14:09 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

I've finally managed to finish and test the pinned extents rework. So here it is.

The idea is to move pinnex extents tracking from the global fs_info->pinned_extents,
which is just a pointer to fs_info->freed_extents[] array members to a per
transaction structure. This will allow to cleanup pinned extents information
during transaction abort.

The bulk of the changes are necessary to ensure a valid transaction handle
is passed to every function that utilizes fs_info->pinned_extents. Also it
was necessary to account for the peculiarities of excluded extents which are
also tracked in ->freed_extents array but with a different flag (yuck).

First 9 patches propagate btrfs_trans_handle where it's necessary. Patch 10
factors out pinned extent clean up to make Patch 11 more readable , alternatively
the changes in patch 10 had to be in patch 11 which would have made it messier
for review.

I believe this series doesn't bring any user facing changes it (hopefully)
streamlines the code and makes it apparent what the lifetime of pinned extents
is and paves the way for further cleanups of BUG_ON.

Nikolay Borisov (11):
  btrfs: Perform pinned cleanup directly in btrfs_destroy_delayed_refs
  btrfs: Make btrfs_pin_extent take trans handle
  btrfs: Introduce unaccount_log_buffer
  btrfs: Call btrfs_pin_reserved_extent only during active transaction
  btrfs: Make btrfs_pin_reserved_extent take transaction
  btrfs: Make btrfs_pin_extent_for_log_replay take transaction handle
  btrfs: Make pin_down_extent take btrfs_trans_handle
  btrfs: Pass trans handle to write_pinned_extent_entries
  btrfs: Mark pinned log extents as excluded
  btrfs: Factor out pinned extent clean up in btrfs_delete_unused_bgs
  btrfs: Use btrfs_transaction::pinned_extents

 fs/btrfs/block-group.c       | 85 +++++++++++++++++++++++-------------
 fs/btrfs/ctree.h             | 12 ++---
 fs/btrfs/disk-io.c           | 56 ++++++++++++------------
 fs/btrfs/extent-io-tree.h    |  3 +-
 fs/btrfs/extent-tree.c       | 70 +++++++++++++----------------
 fs/btrfs/free-space-cache.c  |  5 ++-
 fs/btrfs/tests/btrfs-tests.c |  7 +--
 fs/btrfs/transaction.c       |  1 +
 fs/btrfs/transaction.h       |  1 +
 fs/btrfs/tree-log.c          | 70 +++++++++++++++++++----------
 include/trace/events/btrfs.h |  3 +-
 11 files changed, 174 insertions(+), 139 deletions(-)

--
2.17.1


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

end of thread, other threads:[~2020-02-14 15:34 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 14:09 [PATCH 00/11] Make pinned extents tracking per-transaction Nikolay Borisov
2020-01-20 14:09 ` [PATCH 01/11] btrfs: Perform pinned cleanup directly in btrfs_destroy_delayed_refs Nikolay Borisov
2020-01-21 14:22   ` Josef Bacik
2020-01-30 13:51   ` David Sterba
2020-02-05  8:32     ` Nikolay Borisov
2020-01-20 14:09 ` [PATCH 02/11] btrfs: Make btrfs_pin_extent take trans handle Nikolay Borisov
2020-01-21 14:23   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 03/11] btrfs: Introduce unaccount_log_buffer Nikolay Borisov
2020-01-22 20:04   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 04/11] btrfs: Call btrfs_pin_reserved_extent only during active transaction Nikolay Borisov
2020-01-22 20:05   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 05/11] btrfs: Make btrfs_pin_reserved_extent take transaction Nikolay Borisov
2020-01-22 20:06   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 06/11] btrfs: Make btrfs_pin_extent_for_log_replay take transaction handle Nikolay Borisov
2020-01-22 20:06   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 07/11] btrfs: Make pin_down_extent take btrfs_trans_handle Nikolay Borisov
2020-01-22 20:07   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 08/11] btrfs: Pass trans handle to write_pinned_extent_entries Nikolay Borisov
2020-01-22 20:07   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 09/11] btrfs: Mark pinned log extents as excluded Nikolay Borisov
2020-01-22 20:12   ` Josef Bacik
2020-01-30 13:53   ` David Sterba
2020-01-30 14:03     ` Nikolay Borisov
2020-02-05  8:51     ` Nikolay Borisov
2020-01-20 14:09 ` [PATCH 10/11] btrfs: Factor out pinned extent clean up in btrfs_delete_unused_bgs Nikolay Borisov
2020-01-22 20:14   ` Josef Bacik
2020-01-20 14:09 ` [PATCH 11/11] btrfs: Use btrfs_transaction::pinned_extents Nikolay Borisov
2020-01-22 20:21   ` Josef Bacik
2020-01-23  8:54     ` Nikolay Borisov
2020-01-23 13:40       ` Josef Bacik
2020-01-24 10:35   ` [PATCH v2] " Nikolay Borisov
2020-01-24 13:51     ` Josef Bacik
2020-01-24 15:18     ` [PATCH v3] " Nikolay Borisov
2020-01-24 15:27       ` Josef Bacik
2020-01-30 14:02       ` David Sterba
2020-02-06 18:10       ` [PATCH 11/11 " David Sterba
2020-02-06 19:40         ` Nikolay Borisov
2020-02-14 15:33           ` David Sterba
2020-02-06 19:59 ` [PATCH 00/11] Make pinned extents tracking per-transaction David Sterba

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