Repository navigation
telemetry: do not scan the stacks of user-mode threads - #11549
Open
abonislawski wants to merge 1 commit into
Open
abonislawski wants to merge 1 commit into
abonislawski wants to merge 1 commit into
Conversation
The thread telemetry refresh runs in a kernel thread and read the stack of every thread to measure its high-water mark. For a user-mode thread this leaves kernel-ring DTLB entries for its stack. Its window handlers then fault on them and the DSP hangs. Skip the scan for user-mode threads and report 0, unless XTENSA_MMU_FLUSH_AUTOREFILL_DTLBS_ON_SWAP is enabled. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
abonislawski
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
November 27, 2026 08:10
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The safe-scan exception depends on Zephyr Xtensa DTLB flushing code absent from this snapshot, requiring target validation with the option enabled and disabled to confirm user threads resume without DSP hangs.
No open issues 🎉
What changed in this PR
This PR prevents telemetry stack scans from leaving kernel-ring DTLB entries that can cause user-mode threads to fault and hang the DSP.
Changes:
- Skip user-mode stack scans unless
XTENSA_MMU_FLUSH_AUTOREFILL_DTLBS_ON_SWAPis enabled. - Document that skipped stack high-water measurements are reported as 0.
| File | Description |
|---|---|
src/kernel/debug/telemetry/telemetry.c |
Gates user-mode stack scans on the DTLB-flush configuration. |
src/kernel/debug/telemetry/Kconfig |
Documents when user-mode stack measurements are skipped. |
src/include/sof/debug/telemetry/telemetry.h |
Clarifies that stack_usage is 0 when scanning is skipped. |
Review effort: Balanced
PR 11549: test resultsRun date: 2026-11-27 09:22 UTC Tested commit: 4cdd784ffd1e6204b826dfa38d5c2eb2dd2eea50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The thread telemetry refresh runs in a kernel thread and read the stack of every thread to measure its high-water mark. For a user-mode thread this leaves kernel-ring DTLB entries for its stack. Its window handlers then fault on them and the DSP hangs.
Skip the scan for user-mode threads and report 0, unless XTENSA_MMU_FLUSH_AUTOREFILL_DTLBS_ON_SWAP is enabled.