]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
libceph: switch ceph-msgr workqueue from WQ_PERCPU to WQ_UNBOUND
authorViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Thu, 9 Apr 2026 19:09:40 +0000 (12:09 -0700)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 29 Apr 2026 07:53:07 +0000 (09:53 +0200)
The ceph-msgr workqueue was changed to use WQ_PERCPU in commit
27ce71e1ce81 ("net: WQ_PERCPU added to alloc_workqueue users") as part
of a tree-wide transition to make per-CPU workqueue binding explicit.

However, ceph_con_workfn contains a while(true) loop that retries on
-EAGAIN from socket reads and writes, making it capable of hogging a
bound CPU for extended periods. This manifests at runtime as:

  workqueue: ceph_con_workfn hogged CPU for >10000us N times,
  consider switching to WQ_UNBOUND

Switch the workqueue to WQ_UNBOUND so the scheduler can freely place
workers across CPUs, preventing starvation of other work items on the
bound CPU. The loss of cache locality is acceptable for network I/O
work.

Fixes: 27ce71e1ce81 ("net: WQ_PERCPU added to alloc_workqueue users")
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
cc: Alex Markuze <amarkuze@redhat.com>
cc: Ilya Dryomov <idryomov@gmail.com>
cc: Patrick Donnelly <pdonnell@redhat.com>
cc: Ceph Development <ceph-devel@vger.kernel.org>

net/ceph/messenger.c

index 34b3097b4c7b9d95360d0a08e6b9561e40bf9edd..10858ad5a65c46d7102be32f59ceb864c0a8ca34 100644 (file)
@@ -253,7 +253,7 @@ int __init ceph_msgr_init(void)
         * connections, so leave @max_active at default.
         */
        ceph_msgr_wq = alloc_workqueue("ceph-msgr",
-                                      WQ_MEM_RECLAIM | WQ_PERCPU, 0);
+                                      WQ_MEM_RECLAIM | WQ_UNBOUND, 0);
        if (ceph_msgr_wq)
                return 0;