mbox series

[RFC,0/4] xfs: track and skip realloc of busy inodes

Message ID 20220217172518.3842951-1-bfoster@redhat.com (mailing list archive)
Headers show
Series xfs: track and skip realloc of busy inodes | expand

Message

Brian Foster Feb. 17, 2022, 5:25 p.m. UTC
Hi all,

This RFC cleans up some of the previous experimentation I was doing and
turns it into more of a usable prototype. The first couple of patches
are pretty straightforward. Patch 1 is a variant of the previously
posted patch to stamp inodes with a grace period at destroy time. Patch
2 tags inodes with still pending grace periods as busy in the radix
tree. Patch 3 is a quick hack to allow the inode selection algorithms to
fall back to chunk allocation and retry. Patch 4 updates the finobt
selection algorithms to filter records with busy inodes and fall back to
chunk allocation until a usable record is found.

The current status of this work is that it should be functionally
effective in terms of preventing allocation of busy inodes. This can be
measured by lack of RCU stalls, also identified by the tracepoint added
in patch 1 (this should probably assert or warn in the new inode
allocation recycle case since the goal is for that to never happen).
Performance is significantly improved from previous tests with only
patch 1, but still reduced from mainline. However, reduced performance
is to be expected because mainline unsafely reuses inodes rather
aggressively. Therefore, the goal is for something that
preserves/maintains closer to pure inode allocation performance.

I expect that the allocation algorithm can be adapted further to provide
incremental improvements in performance. The first and most obvious step
is to defer freeing of inode chunks to the background to mitigate
repetitive finobt search failure -> new chunk allocation retry sequences
that may be seen with the current prototype. Other improvements may be
possible to make the search algorithm itself more effective. I'm sending
this as a prototype for early feedback and thoughts on approach,
prospective improvements, etc. Thoughts, reviews, flames appreciated.

Brian

Brian Foster (4):
  xfs: require an rcu grace period before inode recycle
  xfs: tag reclaimable inodes with pending RCU grace periods as busy
  xfs: crude chunk allocation retry mechanism
  xfs: skip busy inodes on finobt inode allocation

 fs/xfs/libxfs/xfs_ialloc.c | 99 +++++++++++++++++++++++++++++++++++---
 fs/xfs/xfs_icache.c        | 55 +++++++++++++++++----
 fs/xfs/xfs_inode.h         |  3 +-
 fs/xfs/xfs_trace.h         |  8 ++-
 4 files changed, 146 insertions(+), 19 deletions(-)