]> 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)
committerViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Wed, 15 Apr 2026 18:39:37 +0000 (11:39 -0700)
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 0c2c01b31ef42f9da55f15e1577081f08234dfa4..d9cdd13dfb4b2b6972a22871a014057c346e8d31 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;