DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Harris, James R" <james.r.harris@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>
Subject: Bug in rte_mempool_do_generic_get?
Date: Fri, 24 Feb 2023 03:02:47 +0000	[thread overview]
Message-ID: <BYAPR11MB3303F73F9207639574F29B71DEA89@BYAPR11MB3303.namprd11.prod.outlook.com> (raw)

[-- 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 --]

             reply	other threads:[~2023-02-24  3:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24  3:02 Harris, James R [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB3303F73F9207639574F29B71DEA89@BYAPR11MB3303.namprd11.prod.outlook.com \
    --to=james.r.harris@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).