Repository navigation
Conversation
|
Upstream branch: d5b6dc3 |
ec9266e to
2e69118
Compare
|
Upstream branch: 24a19b9 |
839b854 to
a531f0b
Compare
2e69118 to
3cdd51f
Compare
|
Upstream branch: 4056b3c |
a531f0b to
ba19063
Compare
3cdd51f to
e6ca2c1
Compare
|
Upstream branch: 0fcb05b |
ba19063 to
704e057
Compare
|
Upstream branch: 0fcb05b |
704e057 to
993bfc6
Compare
|
Upstream branch: 0fcb05b |
993bfc6 to
a99383f
Compare
e6ca2c1 to
3d027d5
Compare
|
Upstream branch: 58161ea |
a99383f to
0c5f86d
Compare
3d027d5 to
90ea7e4
Compare
|
Upstream branch: c03c1a1 |
0c5f86d to
72a6bb5
Compare
|
Upstream branch: 6b4b543 |
cfe5a60 to
544dc89
Compare
5d84576 to
6582ed2
Compare
|
Upstream branch: fb2c3f4 |
544dc89 to
139f513
Compare
6582ed2 to
b3a1abc
Compare
|
Upstream branch: d135ab4 |
139f513 to
e000163
Compare
b3a1abc to
712496f
Compare
|
Upstream branch: c339f40 |
e000163 to
6bf98c3
Compare
712496f to
a186880
Compare
|
Upstream branch: d89e1d1 |
6bf98c3 to
db4d016
Compare
a186880 to
46206a3
Compare
|
Upstream branch: 6628e7d |
db4d016 to
28be68d
Compare
46206a3 to
220bd96
Compare
|
Upstream branch: 05441d6 |
28be68d to
a40c7cb
Compare
220bd96 to
6c4625e
Compare
|
Upstream branch: f66469d |
a40c7cb to
a0d55ba
Compare
6c4625e to
c7f678d
Compare
|
Upstream branch: d487237 |
a0d55ba to
46f338b
Compare
c7f678d to
6aa6cd1
Compare
Commit a46c270 ("blk-mq: don't schedule block kworker on isolated CPUs") excluded isolated CPUs from hctx->cpumask to prevent worker threads from executing block work on isolated CPUs. When all CPUs mapped to a hardware queue are isolated (i.e. blk_mq_hctx_empty_cpumask(hctx) evaluates to true), blk_mq_hctx_next_cpu() returns WORK_CPU_UNBOUND with the intention of offloading execution. However, kblockd_workqueue is allocated as a per-CPU workqueue (WQ_PERCPU). When WORK_CPU_UNBOUND is queued on a per-CPU workqueue, the workqueue core resolves the target CPU via raw_smp_processor_id(). Consequently, if a task executing on an isolated CPU submits I/O and triggers an asynchronous queue dispatch with zero delay (e.g. upon hardware queue congestion, tag/resource exhaustion returning BLK_STS_RESOURCE, or plugging), &hctx->run_work is queued directly onto the local isolated CPU's worker pool. This causes the local per-CPU high-priority kworker (e.g. "kworker/6:1H-kblockd") to be scheduled on the isolated CPU. In real-time environments, an active SCHED_FIFO workload will starve this SCHED_NORMAL worker, causing hardware dispatch to stall, in addition to introducing unwanted latency jitter on nohz_full cores, thereby defeating the original objective of commit a46c270. Introduce blk_mq_hctx_unbound_cpu() to select an online housekeeping CPU from housekeeping_cpumask(HK_TYPE_DOMAIN) via cpumask_any_and_distribute() when executing on an isolated CPU, and otherwise fall back to WORK_CPU_UNBOUND. Use this helper across the unbound fallback paths in blk_mq_hctx_next_cpu(). Additionally, for single-queue devices, gate the check behind the static key housekeeping_overridden under CONFIG_CPU_ISOLATION to ensure that common configurations without CPU isolation incur zero overhead on the fast path. This ensures that: 1. When executing on an isolated CPU, deferred queue work is cleanly offloaded to an online housekeeping CPU across single-queue devices, hardware queues with empty cpumasks, and offline CPU fallback paths. 2. The per-CPU high-priority kworker on the isolated CPU is not scheduled, avoiding priority inversion and latency jitter. 3. When executing on a non-isolated CPU, WORK_CPU_UNBOUND is preserved, maintaining optimal local execution with zero CPU bouncing while avoiding timer pinning hazards. 4. On systems without CPU isolation, single-queue devices maintain the zero-overhead fast path via a static key. Fixes: a46c270 ("blk-mq: don't schedule block kworker on isolated CPUs") Cc: Ming Lei <ming.lei@redhat.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: stable@vger.kernel.org Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
|
Upstream branch: b3dfbde |
46f338b to
2310017
Compare
Pull request for series with
subject: blk-mq: dispatch kworker to housekeeping CPU when hctx cpumask is empty
version: 1
url: https://patchwork.kernel.org/series/1183539/