[PATCH 2/7] libnuma: do not recalculate maxconfiguredcpu
Petr Holasek <[email protected]> Thu, 16 Aug 2012 17:16:31 +0200
| Newsgroups | org.kernel.vger.linux-numa |
|---|---|
| Message-ID | <[email protected]> |
The value for maxtconfiguredcpu is already calculated before set_thread_constraints() is called, so there is no reason to call sysconf(_SC_NPROCESSORS_CONF) a second time. Instead just use the global maxconfiguredcpu. Signed-off-by: Mark A. Grondona <[email protected]> Signed-off-by: Petr Holasek <[email protected]> --- numactl-2.0.8-rc4/libnuma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numactl-2.0.8-rc4/libnuma.c b/numactl-2.0.8-rc4/libnuma.c index 302843e..2fd1ad1 100755 --- a/numactl-2.0.8-rc4/libnuma.c +++ b/numactl-2.0.8-rc4/libnuma.c @@ -464,7 +464,7 @@ read_mask(char *s, struct bitmask *bmp) static void set_task_constraints(void) { - int hicpu = sysconf(_SC_NPROCESSORS_CONF)-1; + int hicpu = maxconfiguredcpu; int i; char *buffer = NULL; size_t buflen = 0; -- 1.7.11.4