linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Use global rsv stealing for evict and clean things up
@ 2021-10-28 19:50 Josef Bacik
  2021-10-28 19:50 ` [PATCH 1/4] btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code Josef Bacik
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Josef Bacik @ 2021-10-28 19:50 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Hello,

While trying to remove direct access of fs_info->extent_root I noticed we were
passing root into btrfs_reserve_metadata_bytes() for the sole purpose of
stealing from the global reserve if we were doing orphan cleanup.  This isn't
really necessary anymore, but I needed to clean up a few things

1) We have global reserve stealing logic in the flushing code now that does the
   proper ordering already.  We just hadn't converted evict to this yet, so I've
   done that.
2) Since we already do the global reserve stealing as a part of the reservation
   process we don't need the extra check to steal from the global reserve if we
   fail to make our reservation during orphan cleanup.
3) Since we no longer need this logic we don't need the orphan_cleanup_state bit
   in the root so we can remove that.
4) Finally with all of this removed we don't have a need for root in
   btrfs_reserve_metadata_bytes(), so change it to fs_info and change it's main
   callers as well.

With that we've got more consistent global reserve stealing handling in evict,
and I've cleaned up the reservation path so I no longer have to worry about a
couple of places where we were doing
btrfs_reserve_metadata_bytes(root->extent_root).  Thanks,

Josef Bacik (4):
  btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code
  btrfs: remove global rsv stealing logic for orphan cleanup
  btrfs: get rid of root->orphan_cleanup_state
  btrfs: change root to fs_info for btrfs_reserve_metadata_bytes

 fs/btrfs/block-group.c    |  2 +-
 fs/btrfs/block-rsv.c      | 12 +++++++-----
 fs/btrfs/block-rsv.h      |  4 ++--
 fs/btrfs/ctree.h          |  9 ++-------
 fs/btrfs/delalloc-space.c |  2 +-
 fs/btrfs/delayed-inode.c  |  2 +-
 fs/btrfs/delayed-ref.c    |  4 ++--
 fs/btrfs/disk-io.c        |  1 -
 fs/btrfs/inode.c          | 21 ++++++++-------------
 fs/btrfs/props.c          |  5 +++--
 fs/btrfs/relocation.c     | 17 +++++++++--------
 fs/btrfs/root-tree.c      |  2 +-
 fs/btrfs/space-info.c     | 34 ++++++++++++++++++++++++----------
 fs/btrfs/space-info.h     |  2 +-
 fs/btrfs/transaction.c    |  4 ++--
 15 files changed, 64 insertions(+), 57 deletions(-)

-- 
2.26.3


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

end of thread, other threads:[~2021-11-04 13:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 19:50 [PATCH 0/4] Use global rsv stealing for evict and clean things up Josef Bacik
2021-10-28 19:50 ` [PATCH 1/4] btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code Josef Bacik
2021-11-04 12:52   ` Nikolay Borisov
2021-10-28 19:50 ` [PATCH 2/4] btrfs: remove global rsv stealing logic for orphan cleanup Josef Bacik
2021-11-04 12:53   ` Nikolay Borisov
2021-10-28 19:50 ` [PATCH 3/4] btrfs: get rid of root->orphan_cleanup_state Josef Bacik
2021-11-04 12:55   ` Nikolay Borisov
2021-11-04 13:08     ` Nikolay Borisov
2021-10-28 19:50 ` [PATCH 4/4] btrfs: change root to fs_info for btrfs_reserve_metadata_bytes Josef Bacik
2021-11-04 13:40   ` Nikolay Borisov

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