linux/fs/xfs
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
..
linux-2.6 xfs: introduce background inode reclaim work 2011-04-08 12:45:07 +10:00
quota xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
support xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
Kconfig
Makefile Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs 2011-03-21 14:24:56 -07:00
xfs.h
xfs_acl.h fs: provide rcu-walk aware permission i_ops 2011-01-07 17:50:29 +11:00
xfs_ag.h xfs: convert pag_ici_lock to a spin lock 2010-12-16 17:08:41 +11:00
xfs_alloc.c xfs: factor agf counter updates into a helper 2011-03-09 08:23:47 -06:00
xfs_alloc.h xfs: limit extent length for allocation to AG size 2011-01-28 09:05:35 -06:00
xfs_alloc_btree.c
xfs_alloc_btree.h
xfs_arch.h
xfs_attr.c
xfs_attr.h
xfs_attr_leaf.c xfs: use KM_NOFS for allocations during attribute list operations 2010-12-23 11:57:37 +11:00
xfs_attr_leaf.h
xfs_attr_sf.h
xfs_bit.c
xfs_bit.h
xfs_bmap.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_bmap.h
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_btree.c xfs: connect up buffer reclaim priority hooks 2010-12-02 16:31:13 +11:00
xfs_btree.h
xfs_btree_trace.c
xfs_btree_trace.h
xfs_buf_item.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_buf_item.h
xfs_da_btree.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_da_btree.h
xfs_dfrag.c xfs: convert xfs_fs_cmn_err to new error logging API 2011-03-07 10:05:35 +11:00
xfs_dfrag.h
xfs_dinode.h
xfs_dir2.c xfs: convert xfs_fs_cmn_err to new error logging API 2011-03-07 10:05:35 +11:00
xfs_dir2.h
xfs_dir2_block.c
xfs_dir2_block.h
xfs_dir2_data.c
xfs_dir2_data.h
xfs_dir2_leaf.c
xfs_dir2_leaf.h
xfs_dir2_node.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_dir2_node.h
xfs_dir2_sf.c
xfs_dir2_sf.h
xfs_error.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_error.h xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
xfs_extfree_item.c xfs: fix efi item leak on forced shutdown 2011-01-28 09:01:33 -06:00
xfs_extfree_item.h xfs: Pull EFI/EFD handling out from under the AIL lock 2010-12-20 11:59:49 +11:00
xfs_filestream.c
xfs_filestream.h
xfs_fs.h
xfs_fsops.c xfs: convert xfs_fs_cmn_err to new error logging API 2011-03-07 10:05:35 +11:00
xfs_fsops.h xfs: ensure log covering transactions are synchronous 2011-01-11 20:28:17 -06:00
xfs_ialloc.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_ialloc.h
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_iget.c Merge branch 'master' into for-linus-merged 2011-01-10 21:35:55 -06:00
xfs_inode.c xfs: introduce inode cluster buffer trylocks for xfs_iflush 2011-03-26 09:13:55 +11:00
xfs_inode.h xfs: add lockdep annotations for the rt inodes 2011-02-07 13:29:18 -06:00
xfs_inode_item.c xfs: fix extent format buffer allocation size 2011-04-08 12:45:07 +10:00
xfs_inode_item.h
xfs_inum.h
xfs_iomap.c xfs: rename xfs_cmn_err_fsblock_zero() 2011-03-07 10:06:35 +11:00
xfs_iomap.h
xfs_itable.c
xfs_itable.h
xfs_log.c xfs: Convert xlog_warn to new logging interface 2011-03-07 10:01:35 +11:00
xfs_log.h xfs: handle CIl transaction commit failures correctly 2011-01-28 09:05:36 -06:00
xfs_log_cil.c xfs: handle CIl transaction commit failures correctly 2011-01-28 09:05:36 -06:00
xfs_log_priv.h xfs: Convert xlog_warn to new logging interface 2011-03-07 10:01:35 +11:00
xfs_log_recover.c xfs: Convert xlog_warn to new logging interface 2011-03-07 10:01:35 +11:00
xfs_log_recover.h
xfs_mount.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_mount.h xfs: introduce background inode reclaim work 2011-04-08 12:45:07 +10:00
xfs_mru_cache.c xfs: convert to alloc_workqueue() 2011-02-01 11:42:43 +01:00
xfs_mru_cache.h
xfs_quota.h xfs: Convert xlog_warn to new logging interface 2011-03-07 10:01:35 +11:00
xfs_rename.c xfs: log timestamp changes to the source inode in rename 2010-12-09 17:07:02 -06:00
xfs_rtalloc.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_rtalloc.h xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_rw.c xfs: Convert remaining cmn_err() callers to new API 2011-03-07 10:08:35 +11:00
xfs_rw.h
xfs_sb.h
xfs_trans.c xfs: handle CIl transaction commit failures correctly 2011-01-28 09:05:36 -06:00
xfs_trans.h xfs: more sensible inode refcounting for ialloc 2011-02-22 20:32:28 -06:00
xfs_trans_ail.c xfs: convert xfs_cmn_err to xfs_alert_tag 2011-03-07 10:02:35 +11:00
xfs_trans_buf.c xfs: xfs_trans_read_buf() should return an error on failure 2011-03-26 09:14:44 +11:00
xfs_trans_extfree.c xfs: Pull EFI/EFD handling out from under the AIL lock 2010-12-20 11:59:49 +11:00
xfs_trans_inode.c xfs: more sensible inode refcounting for ialloc 2011-02-22 20:32:28 -06:00
xfs_trans_priv.h xfs: use AIL bulk delete function to implement single delete 2010-12-20 12:36:15 +11:00
xfs_trans_space.h
xfs_types.h
xfs_utils.c
xfs_utils.h
xfs_vnodeops.c xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00
xfs_vnodeops.h xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00