linux/fs/xfs/linux-2.6
David Chinner 249a8c1124 [XFS] Move AIL pushing into it's own thread
When many hundreds to thousands of threads all try to do simultaneous
transactions and the log is in a tail-pushing situation (i.e. full), we
can get multiple threads walking the AIL list and contending on the AIL
lock.

The AIL push is, in effect, a simple I/O dispatch algorithm complicated by
the ordering constraints placed on it by the transaction subsystem. It
really does not need multiple threads to push on it - even when only a
single CPU is pushing the AIL, it can push the I/O out far faster that
pretty much any disk subsystem can handle.

So, to avoid contention problems stemming from multiple list walkers, move
the list walk off into another thread and simply provide a "target" to
push to. When a thread requires a push, it sets the target and wakes the
push thread, then goes to sleep waiting for the required amount of space
to become available in the log.

This mechanism should also be a lot fairer under heavy load as the waiters
will queue in arrival order, rather than queuing in "who completed a push
first" order.

Also, by moving the pushing to a separate thread we can do more
effectively overload detection and prevention as we can keep context from
loop iteration to loop iteration. That is, we can push only part of the
list each loop and not have to loop back to the start of the list every
time we run. This should also help by reducing the number of items we try
to lock and/or push items that we cannot move.

Note that this patch is not intended to solve the inefficiencies in the
AIL structure and the associated issues with extremely large list
contents. That needs to be addresses separately; parallel access would
cause problems to any new structure as well, so I'm only aiming to isolate
the structure from unbounded parallelism here.

SGI-PV: 972759
SGI-Modid: xfs-linux-melb:xfs-kern:30371a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
2008-02-07 18:22:51 +11:00
..
kmem.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
kmem.h Slab API: remove useless ctor parameter and reorder parameters 2007-10-17 08:42:45 -07:00
mrlock.h [XFS] Add lockdep support for XFS 2007-05-08 13:50:19 +10:00
mutex.h
sema.h
sv.h
time.h
xfs_aops.c [XFS] optimize XFS_IS_REALTIME_INODE w/o realtime config 2008-02-07 18:16:43 +11:00
xfs_aops.h [XFS] move v_iocount from bhv_vnode to xfs_inode 2007-10-16 11:38:56 +10:00
xfs_buf.c [XFS] kill superflous buffer locking (2nd attempt) 2008-02-07 18:18:50 +11:00
xfs_buf.h [XFS] kill superflous buffer locking (2nd attempt) 2008-02-07 18:18:50 +11:00
xfs_cred.h
xfs_dmapi_priv.h
xfs_export.c [XFS] Cleanup various fid related bits: 2008-02-07 18:20:11 +11:00
xfs_export.h xfs: new export ops 2007-10-22 08:13:20 -07:00
xfs_file.c [XFS] fix unaligned access in readdir 2008-01-11 18:05:04 +11:00
xfs_fs_subr.c [XFS] kill the v_flag member in struct bhv_vnode 2007-10-16 11:37:29 +10:00
xfs_fs_subr.h [XFS] decontaminate vnode operations from behavior details 2007-10-15 16:54:29 +10:00
xfs_globals.c [XFS] Fix up sparse warnings. 2008-02-07 18:14:38 +11:00
xfs_globals.h [XFS] Remove xfs_physmem 2007-10-15 16:40:14 +10:00
xfs_ioctl.c [XFS] optimize XFS_IS_REALTIME_INODE w/o realtime config 2008-02-07 18:16:43 +11:00
xfs_ioctl32.c [XFS] Fix up sparse warnings. 2008-02-07 18:14:38 +11:00
xfs_ioctl32.h
xfs_iops.c [XFS] use generic_permission 2008-02-07 18:22:38 +11:00
xfs_iops.h [XFS] call common xfs vnode-level helpers directly and remove vnode operations 2007-10-16 10:40:00 +10:00
xfs_linux.h [XFS] Remove the BPCSHIFT and NB* based macros from XFS. 2008-02-07 18:17:58 +11:00
xfs_lrw.c [XFS] Remove the BPCSHIFT and NB* based macros from XFS. 2008-02-07 18:17:58 +11:00
xfs_lrw.h [XFS] kill xfs_iocore_t 2008-02-07 16:48:58 +11:00
xfs_stats.c
xfs_stats.h
xfs_super.c [XFS] Move AIL pushing into it's own thread 2008-02-07 18:22:51 +11:00
xfs_super.h exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
xfs_sysctl.c [XFS] Concurrent Multi-File Data Streams 2007-07-14 15:40:53 +10:00
xfs_sysctl.h [XFS] Concurrent Multi-File Data Streams 2007-07-14 15:40:53 +10:00
xfs_version.h
xfs_vfs.h [XFS] kill struct bhv_vfs 2007-10-16 12:17:27 +10:00
xfs_vnode.c [XFS] cleanup vnode useage in xfs_iget.c 2008-02-07 16:55:46 +11:00
xfs_vnode.h [XFS] cleanup vnode useage in xfs_iget.c 2008-02-07 16:55:46 +11:00