Skip to content
Snippets Groups Projects
Commit e8c44d3b authored by Daniel Bristot de Oliveira's avatar Daniel Bristot de Oliveira
Browse files

rtla/timerlat: Do not stop user-space if a cpu is offline

If no CPU list is passed, timerlat in user-space will dispatch
one thread per sysconf(_SC_NPROCESSORS_CONF). However, not all
CPU might be available, for instance, if HT is disabled.

Currently, rtla timerlat is stopping the session if an user-space
thread cannot set affinity to a CPU, or if a running user-space
thread is killed. However, this is too restrictive.

So, reduce the error to a debug message, and rtla timerlat run as
long as there is at least one user-space thread alive.

Link: https://lore.kernel.org/lkml/59cf2c882900ab7de91c6ee33b382ac7fa6b4ed0.1694781909.git.bristot@kernel.org



Fixes: cdca4f4e ("rtla/timerlat_top: Add timerlat user-space support")
Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
parent 301deca0
No related merge requests found
...@@ -45,7 +45,7 @@ static int timerlat_u_main(int cpu, struct timerlat_u_params *params) ...@@ -45,7 +45,7 @@ static int timerlat_u_main(int cpu, struct timerlat_u_params *params)
retval = sched_setaffinity(gettid(), sizeof(set), &set); retval = sched_setaffinity(gettid(), sizeof(set), &set);
if (retval == -1) { if (retval == -1) {
err_msg("Error setting user thread affinity\n"); debug_msg("Error setting user thread affinity %d, is the CPU online?\n", cpu);
exit(1); exit(1);
} }
...@@ -193,7 +193,9 @@ void *timerlat_u_dispatcher(void *data) ...@@ -193,7 +193,9 @@ void *timerlat_u_dispatcher(void *data)
procs_count--; procs_count--;
} }
} }
break;
if (!procs_count)
break;
} }
sleep(1); sleep(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment