aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2024-03-22 15:32:22 -0400
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>2024-03-22 15:32:22 -0400
commitfffc02aa88d919732cdb91c39885bf2a800f997d (patch)
tree6557a098b81c94ccadb661efaaf3aa268ff35a92
parent805d0043db4c6d645a783c1a994d2d43a8e946e1 (diff)
downloadlibrseq-fffc02aa88d919732cdb91c39885bf2a800f997d.tar.gz
mempool: default to per-cpu mempool type
The primary use-case for mempool is per-cpu data. Default to this rather than global. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I63d994de80e8ed16e0f5666a846d7e872a58cdca
-rw-r--r--include/rseq/mempool.h6
-rw-r--r--src/rseq-mempool.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/rseq/mempool.h b/include/rseq/mempool.h
index 5f5e0a6..78cb4a0 100644
--- a/include/rseq/mempool.h
+++ b/include/rseq/mempool.h
@@ -80,12 +80,12 @@ struct rseq_mempool;
* The @attr pointer used to specify the pool attributes. If NULL, use a
* default attribute values. The @attr can be destroyed immediately
* after rseq_mempool_create() returns. The caller keeps ownership
- * of @attr. Default attributes select a global mempool type.
+ * of @attr. Default attributes select a per-cpu mempool type.
*
- * The argument @pool_name can be used to given a name to the pool for
+ * The argument @pool_name can be used to give a name to the pool for
* debugging purposes. It can be NULL if no name is given.
*
- * Returns a pointer to the created percpu pool. Return NULL on error,
+ * Returns a pointer to the created memory pool. Return NULL on error,
* with errno set accordingly:
*
* EINVAL: Invalid argument.
diff --git a/src/rseq-mempool.c b/src/rseq-mempool.c
index c5b4617..730435d 100644
--- a/src/rseq-mempool.c
+++ b/src/rseq-mempool.c
@@ -75,8 +75,8 @@ struct free_list_node {
};
enum mempool_type {
- MEMPOOL_TYPE_GLOBAL = 0, /* Default */
- MEMPOOL_TYPE_PERCPU = 1,
+ MEMPOOL_TYPE_PERCPU = 0, /* Default */
+ MEMPOOL_TYPE_GLOBAL = 1,
};
struct rseq_mempool_attr {