Skip to content

blk-mq: bound blk_hctx_poll() to one jiffy#954

Open
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1110191=>linus-master
Open

blk-mq: bound blk_hctx_poll() to one jiffy#954
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1110191=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

Pull request for series with
subject: blk-mq: bound blk_hctx_poll() to one jiffy
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1110191

@blktests-ci

blktests-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Author

Upstream branch: 9716c08
series: https://patchwork.kernel.org/project/linux-block/list/?series=1110191
version: 1

@blktests-ci

blktests-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Author

Upstream branch: 2a2974b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1110191
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 3257ec1 to af806da Compare June 12, 2026 22:36
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5f78e5d to e48f9db Compare June 13, 2026 01:19
@blktests-ci

blktests-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown
Author

Upstream branch: 062871f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1110191
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from af806da to e93707b Compare June 13, 2026 01:34
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 199644a to e6d9eb8 Compare June 17, 2026 12:02
@blktests-ci

blktests-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1112694
version: 2

@blktests-ci blktests-ci Bot added V2 and removed V1 labels Jun 17, 2026
@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from e93707b to 0914e0c Compare June 17, 2026 12:18
@blktests-ci

blktests-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot added V3 and removed V2 labels Jun 17, 2026
@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 0914e0c to 49d7889 Compare June 17, 2026 16:26
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from e6d9eb8 to 7d8604f Compare June 24, 2026 01:11
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 49d7889 to 5cdff14 Compare June 24, 2026 01:20
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 7d8604f to 4cc45a3 Compare June 26, 2026 08:14
@blktests-ci

blktests-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 4edcdef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 5cdff14 to 58cb0b5 Compare June 26, 2026 08:55
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
@blktests-ci

blktests-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Author

Upstream branch: dc59e4f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 58cb0b5 to 7efa8b9 Compare June 29, 2026 17:58
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 90ffd56 to d52f35a Compare July 2, 2026 19:18
@blktests-ci

blktests-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 87320be
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from 7efa8b9 to c6e8142 Compare July 2, 2026 19:57
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from d52f35a to a644c13 Compare July 6, 2026 08:28
blk_hctx_poll() can busy-poll until a completion is found or
need_resched() becomes true. On preemptible kernels, the scheduler can
set TIF_NEED_RESCHED on the timer tick and preempt the task at IRQ
return before the loop condition re-evaluates it. After the context
switch, the flag is cleared, so the poller can continue spinning instead
of returning to its caller.

This can happen with io_uring IOPOLL reads inside iocb_bio_iopoll(),
which holds the rcu_read_lock() while calling bio_poll(). If another
poller on the same polled queue drains the available completions, this
poller may repeatedly find no completions and remain inside the RCU
read-side critical section long enough to trigger RCU stall reports:

rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
rcu:     Tasks blocked on level-1 rcu_node (CPUs 0-9): P3961
rcu:     (detected by 3, t=60002 jiffies, g=18533, q=4943 ncpus=20)
task:fio state:R  running task     stack:0     pid:3961
Call Trace:
<TASK>
? nvme_poll+0x36/0xa0 [nvme]
? blk_hctx_poll+0x39/0x90
? blk_mq_poll+0x30/0x60
? bio_poll+0x87/0x170
? iocb_bio_iopoll+0x32/0x50
? io_uring_classic_poll+0x25/0x50
? io_do_iopoll+0x216/0x420
? __do_sys_io_uring_enter+0x2c7/0x7c0

Reproducible with:

fio -filename=/dev/nvme0n1 -direct=1 -size=4g -rw=randread \
--numjobs=32 -bs=4K -ioengine=io_uring -hipri=1 -iodepth=1 \
--registerfiles=1 --group_reporting --thread

Record the starting jiffy and exit the loop once jiffies has advanced.
This bounds each blk_hctx_poll() invocation while also covering the
case where the reschedule flag was cleared by the context switch
before the loop condition could observe it.

Fixes: f22ecf9 ("blk-mq: delete task running check in blk_hctx_poll()")
Reviewed-by: Fengnan Chang <changfengnan@bytedance.com>
Suggested-by: Fengnan Chang <changfengnan@bytedance.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Alok Rathore <alok.rathore@samsung.com>
@blktests-ci

blktests-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: 8cdeaa5
series: https://patchwork.kernel.org/project/linux-block/list/?series=1113040
version: 3

@blktests-ci blktests-ci Bot force-pushed the series/1110191=>linus-master branch from c6e8142 to afecf91 Compare July 6, 2026 09:34
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from a644c13 to a2204c3 Compare July 7, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants