xfs: convert to alloc_workqueue()
authorTejun Heo <tj@kernel.org>
Tue, 1 Feb 2011 10:42:43 +0000 (11:42 +0100)
committerTejun Heo <tj@kernel.org>
Tue, 1 Feb 2011 10:42:43 +0000 (11:42 +0100)
Convert from create[_singlethread]_workqueue() to alloc_workqueue().

* xfsdatad_workqueue and xfsconvertd_workqueue are identity converted.
  Using higher concurrency limit might be useful but given the
  complexity of workqueue usage in xfs, proceeding cautiously seems
  better.

* xfs_mru_reap_wq is converted to non-ordered workqueue with max
  concurrency of 1 as the work items don't require any specific
  ordering and already have proper synchronization.  It seems it was
  singlethreaded to save worker threads, which is no longer a concern.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alex Elder <aelder@sgi.com>
Cc: xfs-masters@oss.sgi.com
Cc: Christoph Hellwig <hch@infradead.org>
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/xfs_mru_cache.c

index ac1c7e8378ddd0a63cd33c5dfbcecd2fcfe0e74d..f83a4c830a65e865f8d680849278f5dfa4eb41a2 100644 (file)
@@ -2022,11 +2022,12 @@ xfs_buf_init(void)
        if (!xfslogd_workqueue)
                goto out_free_buf_zone;
 
-       xfsdatad_workqueue = create_workqueue("xfsdatad");
+       xfsdatad_workqueue = alloc_workqueue("xfsdatad", WQ_MEM_RECLAIM, 1);
        if (!xfsdatad_workqueue)
                goto out_destroy_xfslogd_workqueue;
 
-       xfsconvertd_workqueue = create_workqueue("xfsconvertd");
+       xfsconvertd_workqueue = alloc_workqueue("xfsconvertd",
+                                               WQ_MEM_RECLAIM, 1);
        if (!xfsconvertd_workqueue)
                goto out_destroy_xfsdatad_workqueue;
 
index edfa178bafb62e4d147dc74ba9593b622231c25d..4aff56395732591e6d06b8e95d4e6b89ddb59b70 100644 (file)
@@ -309,7 +309,7 @@ xfs_mru_cache_init(void)
        if (!xfs_mru_elem_zone)
                goto out;
 
-       xfs_mru_reap_wq = create_singlethread_workqueue("xfs_mru_cache");
+       xfs_mru_reap_wq = alloc_workqueue("xfs_mru_cache", WQ_MEM_RECLAIM, 1);
        if (!xfs_mru_reap_wq)
                goto out_destroy_mru_elem_zone;