From: Mathieu Desnoyers Date: Fri, 22 Mar 2024 19:32:22 +0000 (-0400) Subject: mempool: default to per-cpu mempool type X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=fffc02aa88d919732cdb91c39885bf2a800f997d;p=librseq.git 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 Change-Id: I63d994de80e8ed16e0f5666a846d7e872a58cdca --- 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 {