xfs
[Top] [All Lists]

[PATCH 0/7] RFC: combine linux and XFS inodes

To: xfs@xxxxxxxxxxx
Subject: [PATCH 0/7] RFC: combine linux and XFS inodes
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 14 Aug 2008 17:14:36 +1000
Sender: xfs-bounce@xxxxxxxxxxx
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 - 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.

However, this means the linux inodes are unhashed, which means we
now need to do our own tracking of dirty state. We do this by
hooking ->dirty_inode and ->set_page_dirty to move the inode to the
superblock dirty list when appropriate. We also need to hook
->drop_inode to ensure we do writeback of dirty inodes during
reclaim. In future, this can be moved entirely into XFS based on
radix tree tags to track dirty inodes instead of a separate list.

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.

The patch series is based on the -master branch of the git tree, and
applies on top of the 'replace mount inode list' patch series, the
generation number removal patch and the xfs_iget split-up into hit
and miss cases patch. Diffstat for the series is as follows:

 linux-2.6/xfs_aops.c    |   32 ++++++++
 linux-2.6/xfs_iops.c    |   21 ++++-
 linux-2.6/xfs_super.c   |  123 +++++++++++++++++++++++++++------
 linux-2.6/xfs_sync.c    |   50 ++++++-------
 linux-2.6/xfs_vnode.c   |    4 -
 quota/xfs_qm_syscalls.c |   20 +++--
 xfs_iget.c              |  175 +++++++++---------------------------------------
 xfs_inode.c             |  110 +++++++++++++++++++++++-------
 xfs_inode.h             |   10 +-
 xfs_itable.c            |   14 +--
 xfs_vfsops.c            |    1
 xfs_vnodeops.c          |   13 ---
 12 files changed, 326 insertions(+), 247 deletions(-)


<Prev in Thread] Current Thread [Next in Thread>