Thread (17 messages) 17 messages, 1 author, 2021-01-26

[rt-tests v3 12/16] rt-numa: Use CPU_SETSIZE as upper loop limit

From: Daniel Wagner <hidden>
Date: 2021-01-26 18:41:56
Subsystem: the rest · Maintainer: Linus Torvalds

The cpeset might not be dense, so user the CPU_SETSIZE as upper limit.

Signed-off-by: Daniel Wagner <redacted>
---
 src/lib/rt-numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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;
-- 
2.30.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help