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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
Signed-off-by: Petr Holasek <pholasek@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux