This patch tries to fix cpus_online() for powerpc64 when running fio
by using parameter "cpus_allowed", in order to obtain correct max CPU
number on powerpc64 architecture.
When changing SMT settings on powerpc architecture, the way of cpu
numbering is changing as well. For example, when SMT=off, CPUs are
numbered like 0,8,16,..., while when SMT=2, CPUs are numbered like
0,1,8,9,.... Therefore, sysconf(_SC_NPROCESSORS_ONLN) is not applied
to get exact max CPU number on powerpc. And the max_cpu value can be
correctly ontained by using sysconf(_SC_NPROCESSORS_CONF).
Signed-off-by: Dan Qing Zhang <dqzhang@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
}
#endif
+#ifdef __powerpc64__
+#define FIO_HAVE_CPU_ONLINE_SYSCONF
+static inline unsigned int cpus_online(void)
+{
+ return sysconf(_SC_NPROCESSORS_CONF);
+}
+#endif
+
#ifndef FIO_HAVE_CPU_ONLINE_SYSCONF
static inline unsigned int cpus_online(void)
{