linux/fs/xfs/linux-2.6
Dave Chinner 16fd536737 xfs: track AGs with reclaimable inodes in per-ag radix tree
https://bugzilla.kernel.org/show_bug.cgi?id=16348

When the filesystem grows to a large number of allocation groups,
the summing of recalimable inodes gets expensive. In many cases,
most AGs won't have any reclaimable inodes and so we are wasting CPU
time aggregating over these AGs. This is particularly important for
the inode shrinker that gets called frequently under memory
pressure.

To avoid the overhead, track AGs with reclaimable inodes in the
per-ag radix tree so that we can find all the AGs with reclaimable
inodes via a simple gang tag lookup. This involves setting the tag
when the first reclaimable inode is tracked in the AG, and removing
the tag when the last reclaimable inode is removed from the tree.
Then the summation process becomes a loop walking the radix tree
summing AGs with the reclaim tag set.

This significantly reduces the overhead of scanning - a 6400 AG
filesystea now only uses about 25% of a cpu in kswapd while slab
reclaim progresses instead of being permanently stuck at 100% CPU
and making little progress. Clean filesystems filesystems will see
no overhead and the overhead only increases linearly with the number
of dirty AGs.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-07-20 09:43:39 +10:00
..
kmem.c
kmem.h
mrlock.h
sv.h
time.h
xfs_acl.c xfs: constify xattr_handler 2010-05-21 18:31:19 -04:00
xfs_aops.c xfs: remove nr_to_write writeback windup. 2010-06-08 18:12:44 -07:00
xfs_aops.h
xfs_buf.c mm: add context argument to shrinker callback 2010-07-19 14:56:17 +10:00
xfs_buf.h
xfs_cred.h
xfs_dmapi_priv.h
xfs_export.c xfs: remove block number from inode lookup code 2010-06-24 11:35:17 +10:00
xfs_export.h
xfs_file.c drop unused dentry argument to ->fsync 2010-05-27 22:05:02 -04:00
xfs_fs_subr.c
xfs_fs_subr.h
xfs_globals.c
xfs_globals.h
xfs_ioctl.c xfs: always use iget in bulkstat 2010-06-23 18:11:11 +10:00
xfs_ioctl.h
xfs_ioctl32.c xfs: remove block number from inode lookup code 2010-06-24 11:35:17 +10:00
xfs_ioctl32.h
xfs_iops.c xfs: Check new inode size is OK before preallocating 2010-05-28 15:19:12 -05:00
xfs_iops.h
xfs_linux.h
xfs_quotaops.c Merge branch 'master' into for-linus 2010-06-04 13:22:30 -05:00
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: convert inode shrinker to per-filesystem contexts 2010-07-20 08:07:02 +10:00
xfs_super.h xfs: constify xattr_handler 2010-05-21 18:31:19 -04:00
xfs_sync.c xfs: track AGs with reclaimable inodes in per-ag radix tree 2010-07-20 09:43:39 +10:00
xfs_sync.h xfs: convert inode shrinker to per-filesystem contexts 2010-07-20 08:07:02 +10:00
xfs_sysctl.c
xfs_sysctl.h
xfs_trace.c xfs: xfs_trace.c: remove duplicated #include 2010-05-28 15:19:24 -05:00
xfs_trace.h xfs: track AGs with reclaimable inodes in per-ag radix tree 2010-07-20 09:43:39 +10:00
xfs_version.h
xfs_vnode.h
xfs_xattr.c xfs: constify xattr_handler 2010-05-21 18:31:19 -04:00