DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC] mempool: modify flush threshold
@ 2021-12-28 14:28 Morten Brørup
  2022-01-07 15:12 ` Bruce Richardson
  0 siblings, 1 reply; 7+ messages in thread
From: Morten Brørup @ 2021-12-28 14:28 UTC (permalink / raw)
  To: Olivier Matz, Andrew Rybchenko, dev

Hi mempool maintainers and DPDK team.

Does anyone know the reason or history why CACHE_FLUSHTHRESH_MULTIPLIER was chosen to be 1.5? I think it is counterintuitive.

The mempool cache flush threshold was introduced in DPDK version 1.3; it was not in DPDK version 1.2. The copyright notice for rte_mempool.c says year 2012.


Here is my analysis:

With the multiplier of 1.5, a mempool cache is allowed to be filled up to 50 % above than its target size before its excess entries are flushed to the mempool (thereby reducing the cache length to the target size).

In the opposite direction, a mempool cache is allowed to be drained completely, i.e. up to 100 % below its target size.

My instinct tells me that it would be more natural to let a mempool cache go the same amount above and below its target size, i.e. using a flush multiplier of 2 instead of 1.5.

Also, the cache should be allowed to fill up to and including the flush threshold, so it is flushed when the threshold is exceeded, instead of when it is reached.

Here is a simplified example:

Imagine a cache target size of 32, corresponding to a typical packet burst. With a flush threshold of 2 (and len > threshold instead of len >= threshold), the cache could hold 1 +/-1 packet bursts. With the current multiplier it can only hold [0 .. 1.5[ packet bursts, not really providing a lot of elasticity.


Med venlig hilsen / Kind regards,
-Morten Brørup


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-28  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 14:28 [RFC] mempool: modify flush threshold Morten Brørup
2022-01-07 15:12 ` Bruce Richardson
2022-01-08 11:00   ` Morten Brørup
2022-01-10  9:40     ` Bruce Richardson
2022-01-24 15:56       ` Olivier Matz
2022-01-28  8:40         ` Morten Brørup
2022-01-28  8:52         ` Morten Brørup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).