kernel-fxtec-pro1x/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 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
kmem.h xfs: replace KM_LARGE with explicit vmalloc use 2010-01-21 13:44:56 -06:00
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: event tracing support 2009-12-14 23:08:16 -06:00
xfs_buf.c mm: add context argument to shrinker callback 2010-07-19 14:56:17 +10:00
xfs_buf.h xfs: add blockdev name to kthreads 2010-05-19 09:58:07 -05:00
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: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
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: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
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: kill xfs_lrw.h 2010-03-01 16:35:44 -06:00
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: event tracing support 2009-12-14 23:08:16 -06:00
xfs_xattr.c xfs: constify xattr_handler 2010-05-21 18:31:19 -04:00