From: Stephen Hemminger [mailto:[email protected]] Sent: Tuesday, 21 July 2026 08.35
>I can't help thinking that there needs to be a more dynamic heuristic. >Keep existing upper limit but only cache as much as gets used. > >There are two main usage models. >One is fast direct recycling which run to completion generates. The other is >when pipeline is used and arrival and departure is on different cores. In the "different cores" usage model, only half the cache size is active on each thread. In the "free/put only" thread, only the upper half is active (since we flush to size/2). In the "alloc/get only" thread, only the lower half is active (since we replenish to size/2). So, doubling the configured cache size will perform the same as an optimal algorithm. But it will waste size/2 objects per "free/put only" thread as dead in the per-thread mempool cache's lower half. Runtime heuristic would introduce a performance cost for checking usage model.

