RE: [PATCH v2] mempool: introduce statistics reset function

Morten Brørup
2026-02-27T21:24:19Z

> From: fengchengwen [mailto:fengchengwen@huawei.com]
> Sent: Friday, 27 February 2026 10.20
>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> Another question:
> How about the overload of mempool stats, If the cost is low, can we
> remove the debug macro? As far as I know, some DPDK applications
> enable
> mempool statistics (maybe self-impl) in the production environment,
> which is mainly used to help locate problems.

Mempool is a core library, so even though the overhead of the mempool statistics is relatively low cost, it is a debug-only facility, and the extra overhead should be not be forced upon users.
IMO, we should keep it build time configurable.

You do raise a good point about the balance tradeoff!
Maybe enabling it for production is worth it for the majority of users. In SmartShare Systems, we enable it for production too.

We should discuss changing the default from disabled to enabled.