Skip to content

XFS: sync and reclaim rework

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 of 28 patches 4 repliesIn review

18 of 28 patches are in this archive. The cover letter announces 28.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/28XFS: remove i_gen from incore inodefs/xfs/xfs_inode.h fs/xfs/xfs_rename.c fs/xfs/xfs_vnodeops.c+4 -380 replies
2/28XFS: move sync code to its own filefs/xfs/Makefile fs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_sync.c +3 more+615 -5600 replies
4/28XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V3fs/xfs/linux-2.6/xfs_sync.c fs/xfs/xfs_inode.c fs/xfs/xfs_inode.h +3 more+22 -640 replies
5/28XFS: Use the inode tree for finding dirty inodes V3fs/xfs/linux-2.6/xfs_sync.c+101 -2600 replies
6/28XFS: Traverse inode trees when releasing dquots V3fs/xfs/quota/xfs_qm_syscalls.c+59 -680 replies
8/28XFS: split out two helpers from xfs_syncsubfs/xfs/linux-2.6/xfs_sync.c+93 -690 replies
9/28XFS: Use struct inodes instead of vnodes to kill vn_grabfs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_vnode.c fs/xfs/linux-2.6/xfs_vnode.h +1 more+37 -430 replies
12/28XFS: xfssyncd: don't call xfs_syncfs/xfs/linux-2.6/xfs_sync.c+14 -20 replies
13/28XFS: make SYNC_ATTR no longer use xfs_syncfs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h +1 more+14 -150 replies
14/28XFS: make SYNC_DELWRI no longer use xfs_syncfs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h+45 -190 replies
16/28XFS: Kill xfs_sync()fs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h fs/xfs/quota/xfs_qm.c +1 more+29 -1530 replies
17/28XFS: Move remaining quiesce code.fs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h +2 more+60 -610 replies
20/28XFS: Never call mark_inode_dirty_sync() directlyfs/xfs/linux-2.6/xfs_aops.c fs/xfs/linux-2.6/xfs_iops.c fs/xfs/linux-2.6/xfs_super.c+3 -30 replies
21/28Inode: Allow external initialisersfs/inode.c include/linux/fs.h+78 -610 replies
23/28XFS: Combine the XFS and Linux inodes.fs/xfs/linux-2.6/xfs_iops.c fs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_vnode.c +4 more+110 -1940 replies
24/28XFS: move inode reclaim functions to xfs_sync.cfs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h fs/xfs/xfs_inode.h +1 more+94 -920 replies
25/28XFS: mark inodes for reclaim via a tag in the inode radix treefs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h fs/xfs/xfs_ag.h +2 more+54 -00 replies
26/28XFS: rename inode reclaim functionsfs/xfs/linux-2.6/xfs_sync.c fs/xfs/linux-2.6/xfs_sync.h fs/xfs/xfs_mount.c +1 more+9 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/28] XFS: sync and reclaim rework

Multiple patch sets, all in one patch bomb against a current git tree. This includes all outstanding patches I have previously sent that are not committed plus a bunch more...

---

XFS: replace the mount inode list with radix tree traversals V4

The list of all inodes on a mount is superfluous. We can traverse all inodes now by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a bunch of complex list traversal code and remove another two pointers from the xfs_inode.

Also, by replacing the sync traversal with an ascending inode number traversal, we will issue better inode I/O patterns for writeback triggered by xfssyncd or unmount.

Before we make this change, move all the relevant sync code into it's own file in the linux-2.6/ directory. This aggregates VFS specific sync interfacing in the one file and will allow all the subsequent change history to be associated with this file so it is easy to find in future.

Version 4:
o revert xfs_syncsub -> xfs_sync change in xfs_quiesce_fs and rediff patch series

---

XFS: clean up sync code

xfs_sync and xfs_syncsub are multiplexed interfaces that shares relatively little code between callers. because it is a multiplexed interface, it's hard to tell what is executed in each context it is called.

Factor out the sync code and explicitly call the sync functions needed rather than the multiplexed interfaces. Once this is done, we can remove xfs_syncsub and xfs_sync altogether.

---

RFC: Combine Linux and XFS inodes V2

XFS currently has to deal with two separate inode lifecycles which makes for complexity in inode lookups and reclaim. We also have the problem of not always having a linux inode around when it might be useful to have it.

To avoid these lifecycle problems, this series embedѕ the linux inode inside the struct xfs_inode and changes the way we reference to two inodes. We can no longer check for a null linux inode - instead we have to check to see if it is valid or not by checking either the linux inode or xfs inode state flags. While this means that inodes waiting for reclaim use more memory, this is not the commonn state for inodes and the will soon be completely freed so the additional memeory use in this state is only a temporary issue.

This combining of the inodes simplifies the inode and reclaim logic, making it possible to do reclaim via radix tree tags (an upcoming patch series) and to be able to use RCU locking on the radix trees. The fact that we don't have a simple mechanism to determine the reclaim state of the inode makes RCU locking very complex, and this complexity is removed by having a combined inode structure.

This patch series also changes the way XFS caches inodes. It no longer uses the linux inode cache as the primary lookup cache - instead we rely solely on the XFS inode caches. This avoids the inode_lock in lookups that hit the cache - we should get much better parallelism out of inode lookup than we currently do now.

The patch series also makes use of the slab 'init once' feature for the XFS inodes. This means we only need to do partial initialisation of the xfs (and embedded linux inode) whenever we allocate a new inode.

In future, we should also be able to cull duplicate fields out of the xfs and linux inodes reducing the overall memory usage of the active inode cache. This provides scope for continuing to reduce the memory footprint of the XFS inode cache.

Version 2
o reorder and rework as a result of review comments.

---

XFS: Track reclaimable inodes in inode cache.

Move the tracking of reclaimable inodes
into the inode radix trees. This currently does not replace
the reclaim flags in the inode, rather it allows traversal of
all reclaimable inodes by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a list and a lock to remove a point of serialisation during inode reclaim.

Like the matching sync code, this also allows reclaim of inodes in ascending inode numbers which substantially improves I/O patterns during reclaim driven inode flushing.

---

Combined diffstat:

 fs/inode.c                     |  205 ++++++----
 fs/xfs/Makefile                |    1
 fs/xfs/linux-2.6/xfs_aops.c    |    2
 fs/xfs/linux-2.6/xfs_iops.c    |   19
 fs/xfs/linux-2.6/xfs_super.c   |  265 +++----------
 fs/xfs/linux-2.6/xfs_super.h   |    3
 fs/xfs/linux-2.6/xfs_sync.c    |  780 +++++++++++++++++++++++++++++++++++++++++
 fs/xfs/linux-2.6/xfs_sync.h    |   55 ++
 fs/xfs/linux-2.6/xfs_vfs.h     |   31 -
 fs/xfs/linux-2.6/xfs_vnode.c   |    6
 fs/xfs/linux-2.6/xfs_vnode.h   |    5
 fs/xfs/quota/xfs_qm.c          |   10
 fs/xfs/quota/xfs_qm_syscalls.c |  137 +++----
 fs/xfs/xfs_ag.h                |    5
 fs/xfs/xfs_iget.c              |  473 +++++++++---------------
 fs/xfs/xfs_inode.c             |  140 ++++---
 fs/xfs/xfs_inode.h             |   22 -
 fs/xfs/xfs_itable.c            |   14
 fs/xfs/xfs_mount.c             |    8
 fs/xfs/xfs_mount.h             |   12
 fs/xfs/xfs_vfsops.c            |  617 --------------------------------
 fs/xfs/xfs_vfsops.h            |    2
 fs/xfs/xfs_vnodeops.c          |  118 ------
 include/linux/fs.h             |    2
 24 files changed, 1391 insertions(+), 1541 deletions(-)