DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Lombardo, Ed" <Ed.Lombardo@netscout.com>,
	"Dmitry Kozlyuk" <dmitry.kozliuk@gmail.com>
Cc: <dev@dpdk.org>
Subject: RE: Need help with reducing VIRT memory
Date: Sat, 4 May 2024 08:51:21 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F41B@smartserver.smartshare.dk> (raw)
In-Reply-To: <CH3PR01MB8470655F0692F99740CE19408F1F2@CH3PR01MB8470.prod.exchangelabs.com>

> From: Lombardo, Ed [mailto:Ed.Lombardo@netscout.com]
> Sent: Friday, 3 May 2024 23.19
> 
> Hi Dmitry,
> Thank you, I will give this a try.

Many arrays in DPDK are statically allocated at the build-time max array size, so tweaking DPDK's build-time configuration parameters will reduce the memory consumption. E.g. we tweak these (using DPDK 17.11):
CONFIG_RTE_MAX_NUMA_NODES
CONFIG_RTE_MAX_LCORE
CONFIG_RTE_MAX_ETHPORTS
CONFIG_RTE_MAX_QUEUES_PER_PORT

> 
> Another angle is how can I calculate or determine when DPDK is
> initialized how much total memory DPDK will use.  Then I can provide
> this to our application core and then they can take the DPDK memory max
> requirement and subtract it from the total memory and this amount of
> memory can be locked down by the app core.  The application does not
> want the locked down memory to be used by anything else.  (just an idea
> I thought of).

I would love having this ability too. However, it depends on too many parameters, both build time and run-time, to be truly predictable. You have to run your application's DPDK initialization and configuration stages, and then measure it. That will help provide an estimate.

You can check the memory consumption after calling rte_eal_init() and at different stages of application initialization, like this:

struct rte_malloc_socket_stats stats, stats_sum;
unsigned int socket;

memset(&stats_sum, 0, sizeof(stats_sum));
/* Iterate through all initialized heaps */
for (socket=0; socket< RTE_MAX_NUMA_NODES; socket++) {
    if (rte_malloc_get_socket_stats(socket, &stats) < 0)
        continue;

    stats_sum.heap_totalsz_bytes += stats.heap_totalsz_bytes;
    stats_sum.heap_freesz_bytes += stats.heap_freesz_bytes;
    stats_sum.heap_allocsz_bytes += stats.heap_allocsz_bytes;
}
printf("DPDK hugemem used after rte_eal_init(): %.01f MB\n",
        (float)stats_sum.heap_allocsz_bytes / (float)(1024 * 1024));

> 
> Thanks,
> Ed
> 
> -----Original Message-----
> From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Sent: Friday, May 3, 2024 4:57 PM
> 
> 2024-05-03 23:54 (UTC+0300), Dmitry Kozlyuk:
> > #define RTE_MAX_MEM_MB_PER_LIST 2024  // see item 4 below
> 
> Typo: 2048

  reply	other threads:[~2024-05-04  6:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 19:05 Lombardo, Ed
2024-05-02 20:03 ` Dmitry Kozlyuk
2024-05-02 20:58   ` Lombardo, Ed
2024-05-03 14:48     ` Lombardo, Ed
2024-05-03 15:27       ` Bruce Richardson
2024-05-03 15:52         ` Bruce Richardson
2024-05-03 18:58           ` Morten Brørup
2024-05-03 20:07             ` Lombardo, Ed
2024-05-03 20:54       ` Dmitry Kozlyuk
2024-05-03 20:56         ` Dmitry Kozlyuk
2024-05-03 21:18           ` Lombardo, Ed
2024-05-04  6:51             ` Morten Brørup [this message]
2024-05-05  3:25           ` Lombardo, Ed
2024-05-05  9:35             ` Dmitry Kozlyuk

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=98CBD80474FA8B44BF855DF32C47DC35E9F41B@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=Ed.Lombardo@netscout.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.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).