All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt-numa: Fix the value to check in numa_initialize()
@ 2021-12-22  6:28 Oscar Shiang
  2021-12-22 15:45 ` John Kacur
  0 siblings, 1 reply; 3+ messages in thread
From: Oscar Shiang @ 2021-12-22  6:28 UTC (permalink / raw)
  To: linux-rt-users; +Cc: jkacur, williams, Oscar Shiang

According to numa(3) [1], all numa functions are undefined if
numa_available() returns -1.

Thus numa_initialize() should not return 0, which indicates
libnuma is available, if numa_available() returns -1. It should
return 1 instead.

[1]: https://man7.org/linux/man-pages/man3/numa.3.html

Signed-off-by: Oscar Shiang <oscar0225@livemail.tw>
---
 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 bb0121a..47a643e 100644
--- a/src/lib/rt-numa.c
+++ b/src/lib/rt-numa.c
@@ -25,7 +25,7 @@ int numa_initialize(void)
 	if (is_initialized == 1)
 		return numa;
 
-	if (numa_available() != -1)
+	if (numa_available() == -1)
 		numa = 1;
 
 	is_initialized = 1;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-23  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  6:28 [PATCH] rt-numa: Fix the value to check in numa_initialize() Oscar Shiang
2021-12-22 15:45 ` John Kacur
2021-12-23  6:29   ` 向 景亘

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.