All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oscar Shiang <oscar0225@livemail.tw>
To: linux-rt-users@vger.kernel.org
Cc: jkacur@redhat.com, williams@redhat.com,
	Oscar Shiang <oscar0225@livemail.tw>
Subject: [PATCH] rt-numa: Fix the value to check in numa_initialize()
Date: Wed, 22 Dec 2021 14:28:03 +0800	[thread overview]
Message-ID: <TYCP286MB1913E08DE65A54E19F3286F3A17D9@TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM> (raw)

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


             reply	other threads:[~2021-12-22  6:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  6:28 Oscar Shiang [this message]
2021-12-22 15:45 ` [PATCH] rt-numa: Fix the value to check in numa_initialize() John Kacur
2021-12-23  6:29   ` 向 景亘

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TYCP286MB1913E08DE65A54E19F3286F3A17D9@TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM \
    --to=oscar0225@livemail.tw \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.