mempool: default to per-cpu mempool type
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 22 Mar 2024 19:32:22 +0000 (15:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 22 Mar 2024 19:32:22 +0000 (15:32 -0400)
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

include/rseq/mempool.h
src/rseq-mempool.c

index 5f5e0a616d5ae8795b88553e2fdf1931a0fdeebc..78cb4a0e3bcc4e83e2d7884a745a45c60bd85249 100644 (file)
@@ -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.
index c5b46178cdf7b8efcab00fbef7d4b499086a62ec..730435d7805c601a999b74d7e32897dc72972747 100644 (file)
@@ -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 {
This page took 0.034501 seconds and 4 git commands to generate.