On 10/8/25 08:04, Christoph Hellwig wrote:
> On Tue, Oct 07, 2025 at 10:03:04AM +0200, Vlastimil Babka wrote:
>> Basically it's for situations where you have an upper bound on the objects
>> you might need to allocate in some restricted context where you can't fail
>> but also can't reclaim etc. The steps are:
> 
> Ok, so you still need a step where you reserve, which can fail and
> only after that guarantee you can allocate up to the reservation?  I.e.
> not a replacement for mempools?  Just asking because I recently had

Yeah, not a replacement for mempools which have their special semantics.

> to implement a mempool_alloc_batch to allow grabbing multiple objects
> out of a mempool safely for something I'm working on.

I can imagine allocating multiple objects can be difficult to achieve with
the mempool's guaranteed progress semantics. Maybe the mempool could serve
prefilled sheaves?

Reply via email to