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>
* 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;