summaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_sync.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-04-08 04:45:07 +0200
committerDave Chinner <david@fromorbit.com>2011-04-08 04:45:07 +0200
commitfd074841cfe01b006465fb9388091012585e8dfb (patch)
tree7ec409fade00b6c18987e1cb2a62443c074ce274 /fs/xfs/linux-2.6/xfs_sync.c
parentxfs: clean up code layout in xfs_trans_ail.c (diff)
downloadlinux-fd074841cfe01b006465fb9388091012585e8dfb.tar.xz
linux-fd074841cfe01b006465fb9388091012585e8dfb.zip
xfs: push the AIL from memory reclaim and periodic sync
When we are short on memory, we want to expedite the cleaning of dirty objects. Hence when we run short on memory, we need to kick the AIL flushing into action to clean as many dirty objects as quickly as possible. To implement this, sample the lsn of the log item at the head of the AIL and use that as the push target for the AIL flush. Further, we keep items in the AIL that are dirty that are not tracked any other way, so we can get objects sitting in the AIL that don't get written back until the AIL is pushed. Hence to get the filesystem to the idle state, we might need to push the AIL to flush out any remaining dirty objects sitting in the AIL. This requires the same push mechanism as the reclaim push. This patch also renames xfs_trans_ail_tail() to xfs_ail_min_lsn() to match the new xfs_ail_max_lsn() function introduced in this patch. Similarly for xfs_trans_ail_push -> xfs_ail_push. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_sync.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index debe2822c930..9ad956052b69 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -22,6 +22,7 @@
#include "xfs_log.h"
#include "xfs_inum.h"
#include "xfs_trans.h"
+#include "xfs_trans_priv.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_mount.h"
@@ -462,6 +463,9 @@ xfs_sync_worker(
else
xfs_log_force(mp, 0);
error = xfs_qm_sync(mp, SYNC_TRYLOCK);
+
+ /* start pushing all the metadata that is currently dirty */
+ xfs_ail_push_all(mp->m_ail);
}
/* queue us up again */
@@ -1027,8 +1031,9 @@ xfs_reclaim_inode_shrink(
mp = container_of(shrink, struct xfs_mount, m_inode_shrink);
if (nr_to_scan) {
- /* kick background reclaimer */
+ /* kick background reclaimer and push the AIL */
xfs_syncd_queue_reclaim(mp);
+ xfs_ail_push_all(mp->m_ail);
if (!(gfp_mask & __GFP_FS))
return -1;