Skip to content

blk-mq: introduce tag starvation observability#749

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

blk-mq: introduce tag starvation observability#749
blktests-ci[bot] wants to merge 2 commits intolinus-master_basefrom
series/1082868=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Apr 19, 2026

Pull request for series with
subject: blk-mq: introduce tag starvation observability
version: 4
url: https://patchwork.kernel.org/project/linux-block/list/?series=1082868

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 19, 2026

Upstream branch: d60bc14
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 21, 2026

Upstream branch: b4e0758
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

@blktests-ci blktests-ci Bot force-pushed the series/1082868=>linus-master branch from ad75ef4 to ea3175d Compare April 21, 2026 07:05
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ceec5ed to 3b54e52 Compare April 22, 2026 20:20
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: 6596a02
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

@blktests-ci blktests-ci Bot force-pushed the series/1082868=>linus-master branch from ea3175d to 5e1c43e Compare April 22, 2026 20:25
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 3b54e52 to 6a0b974 Compare April 23, 2026 16:58
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 23, 2026

Upstream branch: 507bd4b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

@blktests-ci blktests-ci Bot force-pushed the series/1082868=>linus-master branch from 5e1c43e to 1a6b31a Compare April 23, 2026 17:03
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 6a0b974 to 59ca59b Compare April 24, 2026 00:56
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

@blktests-ci blktests-ci Bot force-pushed the series/1082868=>linus-master branch from 1a6b31a to b2b03b7 Compare April 24, 2026 01:00
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 94f0438 to 857ada9 Compare April 24, 2026 07:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 24, 2026

Upstream branch: dd6c438
series: https://patchwork.kernel.org/project/linux-block/list/?series=1082868
version: 4

In high-performance storage environments, particularly when utilising
RAID controllers with shared tag sets (BLK_MQ_F_TAG_HCTX_SHARED), severe
latency spikes can occur when fast devices (SSDs) are starved of hardware
tags when sharing the same blk_mq_tag_set.

Currently, diagnosing this specific hardware queue contention is
difficult. When a CPU thread exhausts the tag pool, blk_mq_get_tag()
forces the current thread to block uninterruptible via io_schedule().
While this can be inferred via sched:sched_switch or dynamically
traced by attaching a kprobe to blk_mq_mark_tag_wait(), there is no
dedicated, out-of-the-box observability for this event.

This patch introduces the block_rq_tag_wait trace point in the tag
allocation slow-path. It triggers immediately before the thread yields
the CPU, exposing the exact hardware context (hctx) that is starved, the
specific pool experiencing starvation (hardware or software scheduler),
and the total pool depth.

This provides storage engineers and performance monitoring agents
with a zero-configuration, low-overhead mechanism to definitively
identify shared-tag bottlenecks and tune I/O schedulers or cgroup
throttling accordingly.

Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Laurence Oberman <[email protected]>
Tested-by: Laurence Oberman <[email protected]>
Signed-off-by: Aaron Tomlin <[email protected]>
In high-performance storage environments, particularly when utilising
RAID controllers with shared tag sets (BLK_MQ_F_TAG_HCTX_SHARED), severe
latency spikes can occur when fast devices are starved of available
tags.

This patch introduces two new debugfs attributes for each block
hardware queue:
  - /sys/kernel/debug/block/[device]/hctxN/wait_on_hw_tag
  - /sys/kernel/debug/block/[device]/hctxN/wait_on_sched_tag

These files expose atomic counters that increment each time a submitting
context is forced into an uninterruptible sleep via io_schedule() due to
the complete exhaustion of physical driver tags or software scheduler
tags, respectively.

To ensure negligible performance overhead even in production
environments where CONFIG_BLK_DEBUG_FS is actively enabled, this
tracking logic utilises dynamically allocated per-CPU counters. When
this configuration is disabled, the tracking logic compiles down to a
safe no-op.

Signed-off-by: Aaron Tomlin <[email protected]>
@blktests-ci blktests-ci Bot force-pushed the series/1082868=>linus-master branch from b2b03b7 to bbc7fed Compare April 24, 2026 07:55
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.

1 participant