dm bufio: remove use of deprecated create_singlethread_workqueue()
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Tue, 30 Aug 2016 16:49:11 +0000 (22:19 +0530)
committerMike Snitzer <snitzer@redhat.com>
Tue, 30 Aug 2016 23:45:20 +0000 (19:45 -0400)
The workqueue "dm_bufio_wq" queues a single work item &dm_bufio_work so
it doesn't require execution ordering.  Hence, alloc_workqueue() has
been used to replace the deprecated create_singlethread_workqueue().

The WQ_MEM_RECLAIM flag has been set since DM requires forward progress
under memory pressure.

Since there are fixed number of work items, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-bufio.c

index 6571c81465e1867772d042316a42042afb2a702c..8625040bae92fee2da914feeb544c48f2cdce595 100644 (file)
@@ -1879,7 +1879,7 @@ static int __init dm_bufio_init(void)
        __cache_size_refresh();
        mutex_unlock(&dm_bufio_clients_lock);
 
-       dm_bufio_wq = create_singlethread_workqueue("dm_bufio_cache");
+       dm_bufio_wq = alloc_workqueue("dm_bufio_cache", WQ_MEM_RECLAIM, 0);
        if (!dm_bufio_wq)
                return -ENOMEM;