All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v6 00/15] xfs: clean up incore inode walk functions
@ 2021-06-02 22:24 Darrick J. Wong
  2021-06-02 22:25 ` [PATCH 01/15] xfs: move the quotaoff dqrele inode walk into xfs_icache.c Darrick J. Wong
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: Darrick J. Wong @ 2021-06-02 22:24 UTC (permalink / raw)
  To: djwong; +Cc: Christoph Hellwig, Dave Chinner, linux-xfs, david, hch

Hi all,

This ambitious series aims to cleans up redundant inode walk code in
xfs_icache.c, hide implementation details of the quotaoff dquot release
code, and eliminates indirect function calls from incore inode walks.

The first thing it does is to move all the code that quotaoff calls to
release dquots from all incore inodes into xfs_icache.c.  Next, it
separates the goal of an inode walk from the actual radix tree tags that
may or may not be involved and drops the kludgy XFS_ICI_NO_TAG thing.
Finally, we split the speculative preallocation (blockgc) and quotaoff
dquot release code paths into separate functions so that we can keep the
implementations cohesive.

Christoph suggested last cycle that we 'simply' change quotaoff not to
allow deactivating quota entirely, but as these cleanups are to enable
one major change in behavior (deferred inode inactivation) I do not want
to add a second behavior change (quotaoff) as a dependency.

To be blunt: Additional cleanups are not in scope for this series.

Next, I made two observations about incore inode radix tree walks --
since there's a 1:1 mapping between the walk goal and the per-inode
processing function passed in, we can use the goal to make a direct call
to the processing function.  Furthermore, the only caller to supply a
nonzero iter_flags argument is quotaoff, and there's only one INEW flag.

From that observation, I concluded that it's quite possible to remove
two parameters from the xfs_inode_walk* function signatures -- the
iter_flags, and the execute function pointer.  The middle of the series
moves the INEW functionality into the one piece (quotaoff) that wants
it, and removes the indirect calls.

The final observation is that the inode reclaim walk loop is now almost
the same as xfs_inode_walk, so it's silly to maintain two copies.  Merge
the reclaim loop code into xfs_inode_walk.

Lastly, refactor the per-ag radix tagging functions since there's
duplicated code that can be consolidated.

This series is a prerequisite for the next two patchsets, since deferred
inode inactivation will add another inode radix tree tag and iterator
function to xfs_inode_walk.

v2: walk the vfs inode list when running quotaoff instead of the radix
    tree, then rework the (now completely internal) inode walk function
    to take the tag as the main parameter.
v3: merge the reclaim loop into xfs_inode_walk, then consolidate the
    radix tree tagging functions
v4: rebase to 5.13-rc4
v5: combine with the quotaoff patchset, reorder functions to minimize
    forward declarations, split inode walk goals from radix tree tags
    to reduce conceptual confusion
v6: start moving the inode cache code towards the xfs_icwalk prefix

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=inode-walk-cleanups-5.14
---
 fs/xfs/libxfs/xfs_sb.c   |    2 
 fs/xfs/libxfs/xfs_sb.h   |    4 
 fs/xfs/xfs_icache.c      |  848 ++++++++++++++++++++++++++--------------------
 fs/xfs/xfs_icache.h      |   27 -
 fs/xfs/xfs_inode.c       |   22 +
 fs/xfs/xfs_qm.h          |    1 
 fs/xfs/xfs_qm_syscalls.c |   54 ---
 fs/xfs/xfs_super.c       |    2 
 fs/xfs/xfs_trace.h       |   11 -
 9 files changed, 506 insertions(+), 465 deletions(-)


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

end of thread, other threads:[~2021-06-03  1:38 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 22:24 [PATCHSET v6 00/15] xfs: clean up incore inode walk functions Darrick J. Wong
2021-06-02 22:25 ` [PATCH 01/15] xfs: move the quotaoff dqrele inode walk into xfs_icache.c Darrick J. Wong
2021-06-02 22:25 ` [PATCH 02/15] xfs: detach inode dquots at the end of inactivation Darrick J. Wong
2021-06-02 22:25 ` [PATCH 03/15] xfs: move the inode walk functions further down Darrick J. Wong
2021-06-02 22:25 ` [PATCH 04/15] xfs: rename xfs_inode_walk functions to xfs_icwalk Darrick J. Wong
2021-06-03  1:02   ` Dave Chinner
2021-06-02 22:25 ` [PATCH 05/15] xfs: pass the goal of the incore inode walk to xfs_inode_walk() Darrick J. Wong
2021-06-03  1:04   ` Dave Chinner
2021-06-02 22:25 ` [PATCH 06/15] xfs: separate the dqrele_all inode grab logic from xfs_inode_walk_ag_grab Darrick J. Wong
2021-06-03  1:08   ` Dave Chinner
2021-06-02 22:25 ` [PATCH 07/15] xfs: move xfs_inew_wait call into xfs_dqrele_inode Darrick J. Wong
2021-06-02 22:25 ` [PATCH 08/15] xfs: remove iter_flags parameter from xfs_inode_walk_* Darrick J. Wong
2021-06-03  1:09   ` Dave Chinner
2021-06-03  1:38     ` Darrick J. Wong
2021-06-02 22:25 ` [PATCH 09/15] xfs: remove indirect calls from xfs_inode_walk{,_ag} Darrick J. Wong
2021-06-03  1:12   ` Dave Chinner
2021-06-02 22:25 ` [PATCH 10/15] xfs: clean up inode state flag tests in xfs_blockgc_igrab Darrick J. Wong
2021-06-03  1:13   ` Dave Chinner
2021-06-02 22:25 ` [PATCH 11/15] xfs: make the icwalk processing functions clean up the grab state Darrick J. Wong
2021-06-03  1:14   ` Dave Chinner
2021-06-02 22:26 ` [PATCH 12/15] xfs: fix radix tree tag signs Darrick J. Wong
2021-06-02 22:26 ` [PATCH 13/15] xfs: pass struct xfs_eofblocks to the inode scan callback Darrick J. Wong
2021-06-02 22:26 ` [PATCH 14/15] xfs: merge xfs_reclaim_inodes_ag into xfs_inode_walk_ag Darrick J. Wong
2021-06-02 22:26 ` [PATCH 15/15] xfs: refactor per-AG inode tagging functions Darrick J. Wong
2021-06-03  1:16   ` Dave Chinner
2021-06-03  1:27     ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.