From 2564a6029e55d6a0507ebb28a5a01f5dffb0bd56 Mon Sep 17 00:00:00 2001 From: Josef Cejka Date: Thu, 20 Aug 2015 11:52:51 -0400 Subject: [PATCH] btreplay: Fix typo in scaling up the dynamic cpu set size. In get_ncpus, we default to using 4096 CPUs if _SC_NPROCESSORS_CONF isn't enabled. If that is insufficient, sched_getaffinity will fail and we retry after doubling the size of the cpu_set_t allocation. There's a typo in there that means we don't actually double the size and will loop forever allocating the same sized cpu_set_t instead. Signed-off-by: Josef Cejka Signed-off-by: Jeff Mahoney Signed-off-by: Jens Axboe --- btreplay/btreplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c index 5444010..f762279 100644 --- a/btreplay/btreplay.c +++ b/btreplay/btreplay.c @@ -516,7 +516,7 @@ realloc: if (sched_getaffinity(getpid(), size, cpus)) { if( errno == EINVAL && nrcpus < (4096<<4) ) { CPU_FREE(cpus); - nrcpus <= 1; + nrcpus <<= 1; goto realloc; } fatal("sched_getaffinity", ERR_SYSCALL, "Can't get CPU info\n"); -- 2.25.1