linux/fs/xfs/linux-2.6
Dave Chinner 69b491c214 xfs: serialise inode reclaim within an AG
Memory reclaim via shrinkers has a terrible habit of having N+M
concurrent shrinker executions (N = num CPUs, M = num kswapds) all
trying to shrink the same cache. When the cache they are all working
on is protected by a single spinlock, massive contention an
slowdowns occur.

Wrap the per-ag inode caches with a reclaim mutex to serialise
reclaim access to the AG. This will block concurrent reclaim in each
AG but still allow reclaim to scan multiple AGs concurrently. Allow
shrinkers to move on to the next AG if it can't get the lock, and if
we can't get any AG, then start blocking on locks.

To prevent reclaimers from continually scanning the same inodes in
each AG, add a cursor that tracks where the last reclaim got up to
and start from that point on the next reclaim. This should avoid
only ever scanning a small number of inodes at the satart of each AG
and not making progress. If we have a non-shrinker based reclaim
pass, ignore the cursor and reset it to zero once we are done.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
2010-10-18 15:07:55 -05: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: split xfs_itrace_entry 2010-07-26 13:16:44 -05:00
xfs_aops.c xfs: do not discard page cache data on EAGAIN 2010-08-24 11:47:51 +10:00
xfs_aops.h direct-io: move aio_complete into ->end_io 2010-07-26 16:09:02 -05:00
xfs_buf.c xfs: remove buftarg hash for external devices 2010-10-18 15:07:51 -05:00
xfs_buf.h xfs: kill XBF_FS_MANAGED buffers 2010-10-18 15:07:49 -05:00
xfs_cred.h
xfs_export.c xfs: remove xfs_iput_new 2010-07-26 13:16:44 -05:00
xfs_export.h
xfs_file.c xfs: remove a dmapi leftover 2010-07-26 13:16:47 -05: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_globals.h
xfs_ioctl.c xfs: don't use vfs writeback for pure metadata modifications 2010-10-18 15:07:45 -05:00
xfs_ioctl.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_ioctl32.c xfs: Introduce XFS_IOC_ZERO_RANGE 2010-10-18 15:07:25 -05:00
xfs_ioctl32.h
xfs_iops.c xfs: don't use vfs writeback for pure metadata modifications 2010-10-18 15:07:45 -05:00
xfs_iops.h
xfs_linux.h xfs: new truncate sequence 2010-08-09 16:47:42 -04: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: store xfs_mount in the buftarg instead of in the xfs_buf 2010-10-18 15:07:48 -05:00
xfs_super.h xfs: drop dmapi hooks 2010-07-26 13:16:33 -05:00
xfs_sync.c xfs: serialise inode reclaim within an AG 2010-10-18 15:07:55 -05:00
xfs_sync.h xfs: implement batched inode lookups for AG walking 2010-10-18 15:07:53 -05:00
xfs_sysctl.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
xfs_sysctl.h
xfs_trace.c xfs: remove unneeded #include statements 2010-07-26 13:16:33 -05:00
xfs_trace.h xfs: split inode AG walking into separate code for reclaim 2010-10-18 15:07:52 -05: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