Commit a46c270
blk-mq: don't schedule block kworker on isolated CPUs
Kernel parameter of `isolcpus=` or 'nohz_full=' are used to isolate CPUs
for specific task, and it isn't expected to let block IO disturb these CPUs.
blk-mq kworker shouldn't be scheduled on isolated CPUs. Also if isolated
CPUs is run for blk-mq kworker, long block IO latency can be caused.
Kernel workqueue only respects CPU isolation for WQ_UNBOUND, for bound
WQ, the responsibility is on user because CPU is specified as WQ API
parameter, such as mod_delayed_work_on(cpu), queue_delayed_work_on(cpu)
and queue_work_on(cpu).
So not run blk-mq kworker on isolated CPUs by removing isolated CPUs
from hctx->cpumask. Meantime use queue map to check if all CPUs in this
hw queue are offline instead of hctx->cpumask, this way can avoid any
cost in fast IO code path, and is safe since hctx->cpumask are only
used in the two cases.
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Andrew Theurer <atheurer@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Sebastian Jug <sejug@redhat.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Tejun Heo <tj@kernel.org>
Tesed-by: Joe Mario <jmario@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Link: https://lore.kernel.org/r/20240322021244.1056223-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 7d8d357 commit a46c270
1 file changed
Lines changed: 47 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
2163 | 2164 | | |
2164 | 2165 | | |
2165 | 2166 | | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
2166 | 2176 | | |
2167 | 2177 | | |
2168 | 2178 | | |
| |||
2174 | 2184 | | |
2175 | 2185 | | |
2176 | 2186 | | |
2177 | | - | |
| 2187 | + | |
| 2188 | + | |
2178 | 2189 | | |
2179 | 2190 | | |
2180 | 2191 | | |
| |||
3483 | 3494 | | |
3484 | 3495 | | |
3485 | 3496 | | |
3486 | | - | |
3487 | | - | |
| 3497 | + | |
| 3498 | + | |
3488 | 3499 | | |
3489 | | - | |
3490 | | - | |
3491 | | - | |
3492 | | - | |
3493 | | - | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
3494 | 3521 | | |
3495 | 3522 | | |
3496 | 3523 | | |
3497 | 3524 | | |
3498 | 3525 | | |
3499 | 3526 | | |
3500 | 3527 | | |
3501 | | - | |
3502 | | - | |
| 3528 | + | |
3503 | 3529 | | |
3504 | 3530 | | |
3505 | 3531 | | |
| |||
3907 | 3933 | | |
3908 | 3934 | | |
3909 | 3935 | | |
| 3936 | + | |
| 3937 | + | |
3910 | 3938 | | |
3911 | 3939 | | |
3912 | 3940 | | |
| |||
3933 | 3961 | | |
3934 | 3962 | | |
3935 | 3963 | | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
3936 | 3973 | | |
3937 | 3974 | | |
3938 | 3975 | | |
| |||
0 commit comments