[PATCH v2 2/7] libnuma: do not recalculate maxconfiguredcpu

Petr Holasek <[email protected]> Thu, 23 Aug 2012 18:01:54 +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]>
---
 libnuma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libnuma.c b/libnuma.c
index 302843e..2fd1ad1 100755
--- a/libnuma.c
+++ b/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