Skip to content

XFS: Combine Linux and XFS inodes

Dave Chinner linux-fsdevel linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Inode: Allow external initialisersfs/inode.c include/linux/fs.h+79 -620 replies
2/3Inode: Allow external list initialisationfs/inode.c include/linux/fs.h+47 -210 replies
3/3XFS: Combine the XFS and Linux inodes V2fs/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+109 -1942 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/3] XFS: Combine Linux and XFS inodes

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 the 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 common state for inodes and they will soon be completely freed so the additional memeory use in this state is only temporary.

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.

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.