From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Igor Gutorov" <igootorov@gmail.com>, <users@dpdk.org>
Cc: <andrew.rybchenko@oktetlabs.ru>
Subject: RE: Mbuf pool cache size in share-nothing applications
Date: Sat, 5 Oct 2024 19:27:42 +0200 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F77A@smartserver.smartshare.dk> (raw)
In-Reply-To: <CAL7bPf09u_zgRrGvJ8N7e+LskpymvwEt38NKdqC_sYFyUv3f9Q@mail.gmail.com>
> From: Igor Gutorov [mailto:igootorov@gmail.com]
> Sent: Friday, 4 October 2024 15.49
>
> Hi,
>
> I'm a bit confused about certain semantics of `cache_size` in memory
> pools. I'm working on a DPDK application where each Rx queue gets its
> own mbuf mempool. The memory pools are never shared between lcores,
> mbufs are never passed between lcores, and so the deallocation of an
> mbuf will happen on the same lcore where it was allocated on (it is a
> run-to-completion application). Is my understanding correct, that this
> completely eliminates any lock contention, and so `cache_size` can
> safely be set to 0?
Correct.
However, accessing objects in the cache is faster than accessing objects in the backing pool, because the cache is accessed through optimized inline functions.
>
> Also, `rte_pktmbuf_pool_create()` internally calls
> `rte_mempool_create()` with the default `flags`. Would there be a
> performance benefit in creating mempools manually with the
> `RTE_MEMPOOL_F_SP_PUT` and `RTE_MEMPOOL_F_SC_GET` flags set?
If you want higher performance, create the mbuf pools with a large cache. Then your application will rarely access the mempool's backend, so its flags have less significance.
-Morten
prev parent reply other threads:[~2024-10-05 17:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 13:48 Igor Gutorov
2024-10-05 17:27 ` Morten Brørup [this message]
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=98CBD80474FA8B44BF855DF32C47DC35E9F77A@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=igootorov@gmail.com \
--cc=users@dpdk.org \
/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).