diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-29 04:53:48 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-03-05 12:07:42 -0500 |
commit | aa6bf01d391935a8929333bc2e243084ea0c58db (patch) | |
tree | 686c204328f00ae91466267a9f1e85c3c8d767cb /fs/xfs/xfs_super.c | |
parent | 4b217ed9e30f94b6e8e5e262020ef0ceab6113af (diff) |
xfs: use per-filesystem I/O completion workqueues
The new concurrency managed workqueues are cheap enough that we can create
per-filesystem instead of global workqueues. This allows us to remove the
trylock or defer scheme on the ilock, which is not helpful once we have
outstanding log reservations until finishing a size update.
Also allow the default concurrency on this workqueues so that I/O completions
blocking on the ilock for one inode do not block process for another inode.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r-- | fs/xfs/xfs_super.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 5e0d43f231a4..c7f7bc2855a4 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -759,6 +759,36 @@ xfs_setup_devices( | |||
759 | return 0; | 759 | return 0; |
760 | } | 760 | } |
761 | 761 | ||
762 | STATIC int | ||
763 | xfs_init_mount_workqueues( | ||
764 | struct xfs_mount *mp) | ||
765 | { | ||
766 | mp->m_data_workqueue = alloc_workqueue("xfs-data/%s", | ||
767 | WQ_MEM_RECLAIM, 0, mp->m_fsname); | ||
768 | if (!mp->m_data_workqueue) | ||
769 | goto out; | ||
770 | |||
771 | mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", | ||
772 | WQ_MEM_RECLAIM, 0, mp->m_fsname); | ||
773 | if (!mp->m_unwritten_workqueue) | ||
774 | goto out_destroy_data_iodone_queue; | ||
775 | |||
776 | return 0; | ||
777 | |||
778 | out_destroy_data_iodone_queue: | ||
779 | destroy_workqueue(mp->m_data_workqueue); | ||
780 | out: | ||
781 | return -ENOMEM; | ||
782 | } | ||
783 | |||
784 | STATIC void | ||
785 | xfs_destroy_mount_workqueues( | ||
786 | struct xfs_mount *mp) | ||
787 | { | ||
788 | destroy_workqueue(mp->m_data_workqueue); | ||
789 | destroy_workqueue(mp->m_unwritten_workqueue); | ||
790 | } | ||
791 | |||
762 | /* Catch misguided souls that try to use this interface on XFS */ | 792 | /* Catch misguided souls that try to use this interface on XFS */ |
763 | STATIC struct inode * | 793 | STATIC struct inode * |
764 | xfs_fs_alloc_inode( | 794 | xfs_fs_alloc_inode( |
@@ -982,6 +1012,7 @@ xfs_fs_put_super( | |||
982 | xfs_unmountfs(mp); | 1012 | xfs_unmountfs(mp); |
983 | xfs_freesb(mp); | 1013 | xfs_freesb(mp); |
984 | xfs_icsb_destroy_counters(mp); | 1014 | xfs_icsb_destroy_counters(mp); |
1015 | xfs_destroy_mount_workqueues(mp); | ||
985 | xfs_close_devices(mp); | 1016 | xfs_close_devices(mp); |
986 | xfs_free_fsname(mp); | 1017 | xfs_free_fsname(mp); |
987 | kfree(mp); | 1018 | kfree(mp); |
@@ -1308,10 +1339,14 @@ xfs_fs_fill_super( | |||
1308 | if (error) | 1339 | if (error) |
1309 | goto out_free_fsname; | 1340 | goto out_free_fsname; |
1310 | 1341 | ||
1311 | error = xfs_icsb_init_counters(mp); | 1342 | error = xfs_init_mount_workqueues(mp); |
1312 | if (error) | 1343 | if (error) |
1313 | goto out_close_devices; | 1344 | goto out_close_devices; |
1314 | 1345 | ||
1346 | error = xfs_icsb_init_counters(mp); | ||
1347 | if (error) | ||
1348 | goto out_destroy_workqueues; | ||
1349 | |||
1315 | error = xfs_readsb(mp, flags); | 1350 | error = xfs_readsb(mp, flags); |
1316 | if (error) | 1351 | if (error) |
1317 | goto out_destroy_counters; | 1352 | goto out_destroy_counters; |
@@ -1374,6 +1409,8 @@ xfs_fs_fill_super( | |||
1374 | xfs_freesb(mp); | 1409 | xfs_freesb(mp); |
1375 | out_destroy_counters: | 1410 | out_destroy_counters: |
1376 | xfs_icsb_destroy_counters(mp); | 1411 | xfs_icsb_destroy_counters(mp); |
1412 | out_destroy_workqueues: | ||
1413 | xfs_destroy_mount_workqueues(mp); | ||
1377 | out_close_devices: | 1414 | out_close_devices: |
1378 | xfs_close_devices(mp); | 1415 | xfs_close_devices(mp); |
1379 | out_free_fsname: | 1416 | out_free_fsname: |