From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Holasek Subject: [PATCH v2 2/7] libnuma: do not recalculate maxconfiguredcpu Date: Thu, 23 Aug 2012 18:01:54 +0200 Message-ID: <1345737719-11433-3-git-send-email-pholasek@redhat.com> References: <1345737719-11433-1-git-send-email-pholasek@redhat.com> Return-path: In-Reply-To: <1345737719-11433-1-git-send-email-pholasek@redhat.com> Sender: linux-numa-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Cliff Wickman Cc: linux-numa@vger.kernel.org, Andi Kleen , Anton Arapov , Petr Holasek , "Mark A. Grondona" 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 Signed-off-by: Petr Holasek --- 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