Re: [PATCH] mempool: optimize mempool resizing

From: Damien Le Moal

Date: Mon Oct 19 2026 - 05:42:33 EST


On 2026/10/17 11:08, Vitaly Wool wrote:
>>> Imagine you have a mempool with 10000 elements, and you have to reduce it to 3000. Then
>>> if you at some point want to go back to 10000, you'll end up reallocating the elements
>
>> Who is "we" and where is the code? This is a highly unusual, not to
>> say most like broken usage of mempools. If you need changes to support
>> such a use case you should include a link to the intree user (or bundle
>> it with the submission of the new code).
>
> This situation may well happen in the block layer (zoned). The numbers will
> be different but they were arbitrarily chosen in the example above anyway.

The block layer zoned code does not use gigantic buffers from a mempool. The
mempool is only used for small zone write plugs descriptors and if the user goes
over the device advertized max open limit, using lots of plugs, the device perf
will start going to /dev/null. So optimizing for growing the mempool for this
case is really not a priority/needed, at all.


--
Damien Le Moal
Western Digital Research