From: John Kacur <jkacur@redhat.com>
To: Oscar Shiang <oscar0225@livemail.tw>
Cc: linux-rt-users@vger.kernel.org, williams@redhat.com
Subject: Re: [PATCH] rt-numa: Fix the value to check in numa_initialize()
Date: Wed, 22 Dec 2021 10:45:08 -0500 (EST) [thread overview]
Message-ID: <edf1dff-ec8-c42b-d1c-8fba1b96d36d@redhat.com> (raw)
In-Reply-To: <TYCP286MB1913E08DE65A54E19F3286F3A17D9@TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM>
On Wed, 22 Dec 2021, Oscar Shiang wrote:
> 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
>
>
No, it looks to me like the code is correct but the comment is incorrect.
If you submit a patch fixing the comment, I'll apply it.
Thanks
John
next prev parent reply other threads:[~2021-12-22 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=edf1dff-ec8-c42b-d1c-8fba1b96d36d@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=oscar0225@livemail.tw \
--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.