aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2012-11-06 09:50:47 -0500
committerBen Myers <bpm@sgi.com>2012-11-08 16:34:59 -0500
commit579b62faa5fb16ffeeb88cda5e2c4e95730881af (patch)
treeb0d71a823d2b6e5718786f99921968109d8f644e /fs/xfs/xfs_super.c
parent00ca79a04bef1a1b30ef8afd992d905b6d986caf (diff)
xfs: add background scanning to clear eofblocks inodes
Create a new mount workqueue and delayed_work to enable background scanning and freeing of eofblocks inodes. The scanner kicks in once speculative preallocation occurs and stops requeueing itself when no eofblocks inodes exist. The scan interval is based on the new 'speculative_prealloc_lifetime' tunable (default to 5m). The background scanner performs unfiltered, best effort scans (which skips inodes under lock contention or with a dirty cache mapping). Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 3d9ea947e9f8..ab8839b26272 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -874,8 +874,15 @@ xfs_init_mount_workqueues(
874 if (!mp->m_log_workqueue) 874 if (!mp->m_log_workqueue)
875 goto out_destroy_reclaim; 875 goto out_destroy_reclaim;
876 876
877 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s",
878 WQ_NON_REENTRANT, 0, mp->m_fsname);
879 if (!mp->m_eofblocks_workqueue)
880 goto out_destroy_log;
881
877 return 0; 882 return 0;
878 883
884out_destroy_log:
885 destroy_workqueue(mp->m_log_workqueue);
879out_destroy_reclaim: 886out_destroy_reclaim:
880 destroy_workqueue(mp->m_reclaim_workqueue); 887 destroy_workqueue(mp->m_reclaim_workqueue);
881out_destroy_cil: 888out_destroy_cil:
@@ -892,6 +899,7 @@ STATIC void
892xfs_destroy_mount_workqueues( 899xfs_destroy_mount_workqueues(
893 struct xfs_mount *mp) 900 struct xfs_mount *mp)
894{ 901{
902 destroy_workqueue(mp->m_eofblocks_workqueue);
895 destroy_workqueue(mp->m_log_workqueue); 903 destroy_workqueue(mp->m_log_workqueue);
896 destroy_workqueue(mp->m_reclaim_workqueue); 904 destroy_workqueue(mp->m_reclaim_workqueue);
897 destroy_workqueue(mp->m_cil_workqueue); 905 destroy_workqueue(mp->m_cil_workqueue);
@@ -1393,6 +1401,7 @@ xfs_fs_fill_super(
1393 mutex_init(&mp->m_growlock); 1401 mutex_init(&mp->m_growlock);
1394 atomic_set(&mp->m_active_trans, 0); 1402 atomic_set(&mp->m_active_trans, 0);
1395 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); 1403 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker);
1404 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker);
1396 1405
1397 mp->m_super = sb; 1406 mp->m_super = sb;
1398 sb->s_fs_info = mp; 1407 sb->s_fs_info = mp;