libceph: ceph-msgr workqueue needs a resque worker
authorIlya Dryomov <idryomov@redhat.com>
Fri, 10 Oct 2014 12:39:05 +0000 (16:39 +0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 14 Dec 2014 16:23:48 +0000 (16:23 +0000)
commit f9865f06f7f18c6661c88d0511f05c48612319cc upstream.

Commit f363e45fd118 ("net/ceph: make ceph_msgr_wq non-reentrant")
effectively removed WQ_MEM_RECLAIM flag from ceph_msgr_wq.  This is
wrong - libceph is very much a memory reclaim path, so restore it.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Tested-by: Micha Krause <micha@krausam.de>
Reviewed-by: Sage Weil <sage@redhat.com>
[bwh: Backported to 3.2:
 - Keep passing the WQ_NON_REENTRANT flag too
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ceph/messenger.c

index 7a239f0..e85a8d2 100644 (file)
@@ -99,7 +99,12 @@ struct workqueue_struct *ceph_msgr_wq;
 
 int ceph_msgr_init(void)
 {
-       ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_NON_REENTRANT, 0);
+       /*
+        * The number of active work items is limited by the number of
+        * connections, so leave @max_active at default.
+        */
+       ceph_msgr_wq = alloc_workqueue("ceph-msgr",
+                                      WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
        if (!ceph_msgr_wq) {
                pr_err("msgr_init failed to create workqueue\n");
                return -ENOMEM;