linux/fs/xfs/linux-2.6
Dave Chinner a7b339f1b8 xfs: introduce background inode reclaim work
Background inode reclaim needs to run more frequently that the XFS
syncd work is run as 30s is too long between optimal reclaim runs.
Add a new periodic work item to the xfs syncd workqueue to run a
fast, non-blocking inode reclaim scan.

Background inode reclaim is kicked by the act of marking inodes for
reclaim.  When an AG is first marked as having reclaimable inodes,
the background reclaim work is kicked. It will continue to run
periodically untill it detects that there are no more reclaimable
inodes. It will be kicked again when the first inode is queued for
reclaim.

To ensure shrinker based inode reclaim throttles to the inode
cleaning and reclaim rate but still reclaim inodes efficiently, make it kick the
background inode reclaim so that when we are low on memory we are
trying to reclaim inodes as efficiently as possible. This kick shoul
d not be necessary, but it will protect against failures to kick the
background reclaim when inodes are first dirtied.

To provide the rate throttling, make the shrinker pass do
synchronous inode reclaim so that it blocks on inodes under IO. This
means that the shrinker will reclaim inodes rather than just
skipping over them, but it does not adversely affect the rate of
reclaim because most dirty inodes are already under IO due to the
background reclaim work the shrinker kicked.

These two modifications solve one of the two OOM killer invocations
Chris Mason reported recently when running a stress testing script.
The particular workload trigger for the OOM killer invocation is
where there are more threads than CPUs all unlinking files in an
extremely memory constrained environment. Unlike other solutions,
this one does not have a performance impact on performance when
memory is not constrained or the number of concurrent threads
operating is <= to the number of CPUs.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-04-08 12:45:07 +10:00
..
kmem.c xfs: Convert linux-2.6/ files to new logging interface 2011-03-07 10:00:35 +11:00
kmem.h
mrlock.h
time.h
xfs_acl.c xfs: provide simple rcu-walk ACL implementation 2011-01-07 17:50:30 +11:00
xfs_aops.c Merge branch 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block 2011-03-24 10:16:26 -07:00
xfs_aops.h xfs: kill xfs_iomap 2010-12-16 16:05:51 -06:00
xfs_buf.c xfs: fix unreferenced var error in xfs_buf.c 2011-03-30 23:34:20 -05:00
xfs_buf.h xfs: stop using the page cache to back the buffer cache 2011-03-26 09:16:45 +11:00
xfs_discard.c xfs: check if device support discard in xfs_ioc_trim() 2011-02-22 15:08:44 -06:00
xfs_discard.h xfs: add FITRIM support 2011-01-11 20:28:29 -06:00
xfs_export.c exportfs: Return the minimum required handle size 2011-03-14 09:15:28 -04:00
xfs_export.h
xfs_file.c xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00
xfs_fs_subr.c xfs: use range primitives for xfs page cache operations 2010-10-18 15:07:24 -05:00
xfs_globals.c xfs: remove xfs_cred.h 2010-10-18 15:08:06 -05:00
xfs_ioctl.c xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00
xfs_ioctl.h
xfs_ioctl32.c xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_ioctl32.h xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_iops.c Merge branch 'master' of git://git.infradead.org/users/eparis/selinux into next 2011-03-08 11:38:10 +11:00
xfs_iops.h
xfs_linux.h xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
xfs_message.c xfs: don't name variables "panic" 2011-03-11 16:34:51 -06:00
xfs_message.h xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
xfs_quotaops.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 2010-08-07 12:57:07 -07:00
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: convert ENOSPC inode flushing to use new syncd workqueue 2011-04-08 12:45:07 +10:00
xfs_super.h xfs: remove xfs_version.h 2010-10-18 15:08:04 -05:00
xfs_sync.c xfs: introduce background inode reclaim work 2011-04-08 12:45:07 +10:00
xfs_sync.h xfs: introduce a xfssyncd workqueue 2011-04-08 12:45:07 +10:00
xfs_sysctl.c xfs: Convert linux-2.6/ files to new logging interface 2011-03-07 10:00:35 +11:00
xfs_sysctl.h
xfs_trace.c xfs: remove unneeded #include statements 2010-07-26 13:16:33 -05:00
xfs_trace.h xfs: add FITRIM support 2011-01-11 20:28:29 -06:00
xfs_vnode.h
xfs_xattr.c xfs: constify xattr_handler 2010-05-21 18:31:19 -04:00