Skip to content

fix: correct softirq_latency metric behavior#130

Merged
hao022 merged 1 commit intoccfos:mainfrom
avalonLZ:softirq_lat
Jan 30, 2026
Merged

fix: correct softirq_latency metric behavior#130
hao022 merged 1 commit intoccfos:mainfrom
avalonLZ:softirq_lat

Conversation

@avalonLZ
Copy link
Copy Markdown
Contributor

@avalonLZ avalonLZ commented Jan 30, 2026

fix: correct softirq_latency metric behavior

softirq_raise can be triggered by hard interrupts and is re-entrant.
The previous implementation updated the timestamp on every raise, causing the reported value to reflect the minimum latency, which is misleading and of limited usefulness.

This change introduces a per-softirq guard flag. The timestamp is recorded only on the first softirq_raise and remains unchanged until the corresponding softirq handler runs. This allows the metric to accurately reflect the maximum latency between the initial hard interrupt and the subsequent softirq execution.

go test:
image

functional test:
Enabled the TIMER softirq metric and extended the latency range for validation.
A custom kernel module was used to block softirq processing for 50 ms, and the collected TIMER latency met expectations.
image


fix: correct softirq_latency metric behavior

softirq_raise can be triggered by hard interrupts and is re-entrant.
The previous implementation updated the timestamp on every raise, causing the reported value to reflect the minimum latency, which is misleading and of limited usefulness.

Signed-off-by: lizhong [email protected]

@avalonLZ avalonLZ marked this pull request as draft January 30, 2026 08:42
@avalonLZ avalonLZ marked this pull request as ready for review January 30, 2026 08:59
@redsky110
Copy link
Copy Markdown
Contributor

看起来没问题,请更新一版,把commit message 用英文写一下吧。

@avalonLZ
Copy link
Copy Markdown
Contributor Author

看起来没问题,请更新一版,把commit message 用英文写一下吧。

ok,已修改

@avalonLZ avalonLZ changed the title fix:修复softirq_latency时延指标存在的问题 fix: correct softirq_latency metric behavior Jan 30, 2026
@hao022 hao022 merged commit cbbc1b3 into ccfos:main Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants