Message ID | 20201218161843.1764-18-dwagner@suse.de |
---|---|
State | Superseded |
Headers | show |
Series | [rt-tests,v2,v2,01/20] cyclictest: Always use libnuma | expand |
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c index 3a8441d5151c..45d4f1193d5f 100644 --- a/src/lib/rt-numa.c +++ b/src/lib/rt-numa.c @@ -60,7 +60,7 @@ static int cpu_for_thread_ua(int thread_num, int max_cpus) num_cpus = CPU_COUNT(&cpuset); m = thread_num % num_cpus; - for (i = 0, cpu = 0; i < max_cpus; i++) { + for (i = 0, cpu = 0; i < CPU_SETSIZE; i++) { if (CPU_ISSET(i, &cpuset)) { if (cpu == m) return i;
The cpeset might not be dense, so user the CPU_SETSIZE as upper limit. Reviewed-by: Daniel Wagner <dwagner@suse.de> --- src/lib/rt-numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)