From: Petr Holasek <pholasek@redhat.com>
To: Cliff Wickman <cpw@sgi.com>
Cc: linux-numa@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
	Anton Arapov <anton@redhat.com>, Petr Holasek <pholasek@redhat.com>,
	"Mark A. Grondona" <mgrondona@llnl.gov>
Subject: [PATCH v2 2/7] libnuma: do not recalculate maxconfiguredcpu
Date: Thu, 23 Aug 2012 18:01:54 +0200

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 <mgrondona@llnl.gov>
Signed-off-by: Petr Holasek <pholasek@redhat.com>
---
 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

