DPDK patches and discussions
 help / color / mirror / Atom feed
* Bug in rte_mempool_do_generic_get?
@ 2023-02-24  3:02 Harris, James R
  2023-02-24 12:13 ` Morten Brørup
  0 siblings, 1 reply; 8+ messages in thread
From: Harris, James R @ 2023-02-24  3:02 UTC (permalink / raw)
  To: dev, mb

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

Hi,

I’ve tracked down a regression in SPDK to DPDK commit a2833ecc5 (“mempool: fix get objects from mempool with cache”).

Here’s an example that demonstrates the problem:

Allocate mempool with 2048 buffers and cache size 256.
Core 0 allocates 512 buffers.  Mempool pulls 512 + 256 buffers from backing ring, returns 512 of them to caller, puts the other 256 in core 0 cache.  Backing ring now has 1280 buffers.
Core 1 allocates 512 buffers.  Mempool pulls 512 + 256 buffers from backing ring, returns 512 of them to caller, puts the other 256 in core 1 cache.  Backing ring now has 512 buffers.
Core 2 allocates 512 buffers.  Mempool pulls remaining 512 buffers from backing ring and returns all of them to caller.  Backing ring now has 0 buffers.
Core 3 tries to allocate 512 buffers and it fails.

In the SPDK case, we don’t really need or use the mempool cache in this case, so changing the cache size to 0 fixes the problem and is what we’re going to move forward with.

But the behavior did cause a regression so I thought I’d mention it here.  If you have a mempool with 2048 objects, shouldn’t 4 cores each be able to do a 512 buffer bulk get, regardless of the configured cache size?

Regards,

Jim Harris



[-- Attachment #2: Type: text/html, Size: 2976 bytes --]

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

end of thread, other threads:[~2023-02-27 10:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24  3:02 Bug in rte_mempool_do_generic_get? Harris, James R
2023-02-24 12:13 ` Morten Brørup
2023-02-24 13:56   ` Honnappa Nagarahalli
2023-02-24 16:42     ` Harris, James R
2023-02-26 10:45       ` Morten Brørup
2023-02-27  9:09         ` Olivier Matz
2023-02-27  9:48           ` Morten Brørup
2023-02-27 10:39             ` Olivier Matz

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).