Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie7d24470994b3a6ec805bfec7111ff3492b46997
*/
bool rseq_available(unsigned int query);
+/*
+ * rseq_get_max_nr_cpus: Get the max_nr_cpus auto-detected value.
+ *
+ * Returns the max_nr_cpus auto-detected at pool creation when invoked
+ * with @nr_max_cpus=0 argument.
+ */
+int rseq_get_max_nr_cpus(void);
+
/*
* Values returned can be either the current CPU number, -1 (rseq is
* uninitialized), or -2 (rseq initialization has failed).
#endif
#include "rseq-utils.h"
-#include "smp.h"
+#include <rseq/rseq.h>
/*
* rseq-mempool.c: rseq CPU-Local Storage (CLS) memory allocator.
}
if (attr.max_nr_cpus == 0) {
/* Auto-detect */
- attr.max_nr_cpus = get_possible_cpus_array_len();
+ attr.max_nr_cpus = rseq_get_max_nr_cpus();
if (attr.max_nr_cpus == 0) {
errno = EINVAL;
return NULL;
#include <linux/auxvec.h>
#include <rseq/rseq.h>
+#include "smp.h"
#ifndef AT_RSEQ_FEATURE_SIZE
# define AT_RSEQ_FEATURE_SIZE 27
}
return (int32_t) node_id;
}
+
+int rseq_get_max_nr_cpus(void)
+{
+ return get_possible_cpus_array_len();
+}