rtla/timerlat: Fix "Set OSNOISE_WORKLOAD for kernel threads"
cover rtla/timerlat: Fix "Set OSNOISE_WORKLOAD for kernel threads"
Two rtla commits that fix a bug in setting OSNOISE_WORKLOAD (see the patches for details) were improperly backported to 6.6-stable, referencing non-existent field params->kernel_workload.
Revert the broken backports and backport this properly, using !params->user_hist and !params->user_top instead of the non-existent params->user_workload.
The patchset was tested to build and fix the bug.
Tomas Glozar (4):
Revert "rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads" Revert "rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads" rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.48.1
PATCH 1/4 Revert "rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads"
This reverts commit 41955b6c268154f81e34f9b61cf8156eec0730c0.
The commit breaks rtla build, since params->kernel_workload is not present on 6.6-stable.
--- tools/tracing/rtla/src/timerlat_top.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
tools/tracing/rtla/src/timerlat_top.c +6 -9
@@ -679,15 +679,12 @@ timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params *auto_house_keeping (¶ms->monitored_cpus); } -/* -* Set workload according to type of thread if the kernel supports it. -* On kernels without support, user threads will have already failed -* on missing timerlat_fd, and kernel threads do not need it. -*/ - retval =osnoise_set_workload (top->context, params->kernel_workload); -if (retval <-1 ) { -err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); - goto out_err; +if (params->user_top) { + retval =osnoise_set_workload (top->context,0 ); +if (retval) { +err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); + goto out_err; + } }return 0 ;
Signature · 1 line
2.48.1
Sasha Levin
maintainerRe: [PATCH 6.6 1/4] Revert "rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads"
[ Sasha's backport helper bot ]
Hi,
Summary of potential issues:
⚠️ Could not find matching upstream commit
No upstream commit was identified. Using temporary commit for testing.
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |
PATCH 2/4 Revert "rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads"
In reply to Tomas GlozarThis reverts commit 83b74901bdc9b58739193b8ee6989254391b6ba7.
The commit breaks rtla build, since params->kernel_workload is not present on 6.6-stable.
--- tools/tracing/rtla/src/timerlat_hist.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
tools/tracing/rtla/src/timerlat_hist.c +6 -9
@@ -900,15 +900,12 @@ timerlat_hist_apply_config(struct osnoise_tool *tool, struct timerlat_hist_paramauto_house_keeping (¶ms->monitored_cpus); } -/* -* Set workload according to type of thread if the kernel supports it. -* On kernels without support, user threads will have already failed -* on missing timerlat_fd, and kernel threads do not need it. -*/ - retval =osnoise_set_workload (tool->context, params->kernel_workload); -if (retval <-1 ) { -err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); - goto out_err; +if (params->user_hist) { + retval =osnoise_set_workload (tool->context,0 ); +if (retval) { +err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); + goto out_err; + } }return 0 ;
Signature · 1 line
2.48.1
Sasha Levin
maintainerRe: [PATCH 6.6 2/4] Revert "rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads"
[ Sasha's backport helper bot ]
Hi,
Summary of potential issues:
ℹ️ This is part 2/4 of a series
⚠️ Could not find matching upstream commit
No upstream commit was identified. Using temporary commit for testing.
NOTE: These results are for this patch alone. Full series testing will be performed when all parts are received.
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |
PATCH 3/4 rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
In reply to Tomas Glozarcommit d8d866171a414ed88bd0d720864095fd75461134 upstream.
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a subsequent run with kernel-space threads, leading to rtla collecting no results if the previous run exited abnormally:
$ rtla timerlat hist -u ^\Quit (core dumped) $ rtla timerlat hist -k -d 1s Index over: count: min: avg: max: ALL: IRQ Thr Usr count: 0 0 0 min: - - - avg: - - - max: - - -
The issue persists until OSNOISE_WORKLOAD is set manually by running:
$ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if available to fix the issue.
[ params->kernel_workload does not exist in 6.6, use !params->user_hist ]
--- tools/tracing/rtla/src/timerlat_hist.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
tools/tracing/rtla/src/timerlat_hist.c +9 -6
@@ -900,12 +900,15 @@ timerlat_hist_apply_config(struct osnoise_tool *tool, struct timerlat_hist_paramauto_house_keeping (¶ms->monitored_cpus); } -if (params->user_hist) { - retval =osnoise_set_workload (tool->context,0 ); -if (retval) { -err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); - goto out_err; - } +/* +* Set workload according to type of thread if the kernel supports it. +* On kernels without support, user threads will have already failed +* on missing timerlat_fd, and kernel threads do not need it. +*/ + retval =osnoise_set_workload (tool->context, !params->user_hist); +if (retval <-1 ) { +err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); + goto out_err; }return 0 ;
Signature · 1 line
2.48.1
Sasha Levin
maintainerRe: [PATCH 6.6 3/4] rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: d8d866171a414ed88bd0d720864095fd75461134
Note: The patch differs from the upstream commit:
---
1: d8d866171a414 ! 1: 2b6c95fecd276 rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
@@ Metadata
## Commit message ##
rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
+ commit d8d866171a414ed88bd0d720864095fd75461134 upstream.
+
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a
@@ Commit message
+ [ params->kernel_workload does not exist in 6.6, use
+ !params->user_hist ]
+ Signed-off-by: Tomas Glozar <[email protected]>
## tools/tracing/rtla/src/timerlat_hist.c ##
@@ tools/tracing/rtla/src/timerlat_hist.c: timerlat_hist_apply_config(struct osnoise_tool *tool, struct timerlat_hist_param
- }
+ auto_house_keeping(¶ms->monitored_cpus);
}
- if (params->user_hist) {
@@ tools/tracing/rtla/src/timerlat_hist.c: timerlat_hist_apply_config(struct osnois
+ * On kernels without support, user threads will have already failed
+ * on missing timerlat_fd, and kernel threads do not need it.
+ */
-+ retval = osnoise_set_workload(tool->context, params->kernel_workload);
++ retval = osnoise_set_workload(tool->context, !params->user_hist);
+ if (retval < -1) {
+ err_msg("Failed to set OSNOISE_WORKLOAD option\n");
+ goto out_err;
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |
PATCH 4/4 rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
In reply to Tomas Glozarcommit 217f0b1e990e30a1f06f6d531fdb4530f4788d48 upstream.
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a subsequent run with kernel-space threads, leading to rtla collecting no results if the previous run exited abnormally:
$ rtla timerlat top -u
^\Quit (core dumped)
$ rtla timerlat top -k -d 1s
Timer Latency
0 00:00:01 | IRQ Timer Latency (us) | Thread Timer Latency (us)
CPU COUNT | cur min avg max | cur min avg maxThe issue persists until OSNOISE_WORKLOAD is set manually by running:
$ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if available to fix the issue.
[ params->kernel_workload does not exist in 6.6, use !params->user_top ]
--- tools/tracing/rtla/src/timerlat_top.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
tools/tracing/rtla/src/timerlat_top.c +9 -6
@@ -679,12 +679,15 @@ timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params *auto_house_keeping (¶ms->monitored_cpus); } -if (params->user_top) { - retval =osnoise_set_workload (top->context,0 ); -if (retval) { -err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); - goto out_err; - } +/* +* Set workload according to type of thread if the kernel supports it. +* On kernels without support, user threads will have already failed +* on missing timerlat_fd, and kernel threads do not need it. +*/ + retval =osnoise_set_workload (top->context, !params->user_top); +if (retval <-1 ) { +err_msg ("Failed to set OSNOISE_WORKLOAD option\n" ); + goto out_err; }return 0 ;
Signature · 1 line
2.48.1
Sasha Levin
maintainerRe: [PATCH 6.6 4/4] rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 217f0b1e990e30a1f06f6d531fdb4530f4788d48
Note: The patch differs from the upstream commit:
---
1: 217f0b1e990e3 ! 1: c364e187bdf5b rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
@@ Metadata
## Commit message ##
rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads
+ commit 217f0b1e990e30a1f06f6d531fdb4530f4788d48 upstream.
+
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a
@@ Commit message
+ [ params->kernel_workload does not exist in 6.6, use
+ !params->user_top ]
+ Signed-off-by: Tomas Glozar <[email protected]>
## tools/tracing/rtla/src/timerlat_top.c ##
@@ tools/tracing/rtla/src/timerlat_top.c: timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params *
- }
+ auto_house_keeping(¶ms->monitored_cpus);
}
- if (params->user_top) {
@@ tools/tracing/rtla/src/timerlat_top.c: timerlat_top_apply_config(struct osnoise_
+ * On kernels without support, user threads will have already failed
+ * on missing timerlat_fd, and kernel threads do not need it.
+ */
-+ retval = osnoise_set_workload(top->context, params->kernel_workload);
++ retval = osnoise_set_workload(top->context, !params->user_top);
+ if (retval < -1) {
+ err_msg("Failed to set OSNOISE_WORKLOAD option\n");
+ goto out_err;
}
- if (isatty(STDOUT_FILENO) && !params->quiet)
+ return 0;
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |
Quoted 16 lines · On Fri, 28 Feb 2025 14:57:04 +0100 Tomas Glozar <[email protected]> wrote:
Two rtla commits that fix a bug in setting
OSNOISE_WORKLOAD(see the patches for details) were improperly backported to 6.6-stable, referencing non-existent fieldparams->kernel_workload.Revert the broken backports and backport this properly, using !params->user_hist and !params->user_top instead of the non-existent
params->user_workload.The patchset was tested to build and fix the bug.
Tomas Glozar (4):
Revert "rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads" Revert "rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads" rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads
Quoted 4 lines
tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Greg, can you pull these into 6.6?
Thanks,
-- Steve
Greg Kroah-Hartman
maintainerQuoted 19 lines · Steven Rostedt
Quoted 16 lines · On Fri, 28 Feb 2025 14:57:04 +0100 Tomas Glozar <[email protected]> wrote:
Two rtla commits that fix a bug in setting
OSNOISE_WORKLOAD(see the patches for details) were improperly backported to 6.6-stable, referencing non-existent fieldparams->kernel_workload.Revert the broken backports and backport this properly, using !params->user_hist and !params->user_top instead of the non-existent
params->user_workload.The patchset was tested to build and fix the bug.
Tomas Glozar (4):
Revert "rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads" Revert "rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads" rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads
Quoted 8 lines
Quoted 4 lines
tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Greg, can you pull these into 6.6?
Will do, thanks.
greg k-h
Quoted 16 lines · Tomas Glozar
Two rtla commits that fix a bug in setting
OSNOISE_WORKLOAD(see the patches for details) were improperly backported to 6.6-stable, referencing non-existent fieldparams->kernel_workload.Revert the broken backports and backport this properly, using !params->user_hist and !params->user_top instead of the non-existent
params->user_workload.The patchset was tested to build and fix the bug.
Tomas Glozar (4):
Revert "rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads" Revert "rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads" rtla/timerlat_hist: SetOSNOISE_WORKLOADfor kernel threads rtla/timerlat_top: SetOSNOISE_WORKLOADfor kernel threads
Quoted 4 lines
tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Thanks for a quick fix, it now builds again and the tool appears to work.
With kind regards,
Jan