DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Antonio Di Bacco <a.dibacco.ks@gmail.com>
Cc: users@dpdk.org
Subject: Re: Optimizing memory access with DPDK allocated memory
Date: Fri, 20 May 2022 08:48:43 -0700	[thread overview]
Message-ID: <20220520084843.698f04ee@hermes.local> (raw)
In-Reply-To: <CAO8pfFkGq3pt44AH7mFDrez_7Kr7d+T8y3W7TNoTT0stbr+y_g@mail.gmail.com>

On Fri, 20 May 2022 10:34:46 +0200
Antonio Di Bacco <a.dibacco.ks@gmail.com> wrote:

> Let us say I have two memory channels each one with its own 16GB memory
> module, I suppose the first memory channel will be used when addressing
> physical memory in the range 0 to 0x4 0000 0000 and the second when
> addressing physical memory in the range 0x4 0000 0000 to  0x7 ffff ffff.
> Correct?
> Now, I need to have a 2GB buffer with one "writer" and one "reader", the
> writer writes on half of the buffer (call it A) and, in the meantime, the
> reader reads on the other half (B). When the writer finishes writing its
> half buffer (A), signal it to the reader and they swap,  the reader starts
> to read from A and writer starts to write to B.
> If I allocate the whole buffer (on two 1GB hugepages) across the two memory
> channels, one half of the buffer is allocated on the end of first channel
> while the other half is allocated on the start of the second memory
> channel, would this increase performances compared to the whole buffer
> allocated within the same memory channel?

Most systems just interleave memory chips based on number of filled slots.
This is handled by BIOS before kernel even starts.
The DPDK has a number of memory channels parameter and what it does
is try and optimize memory allocation by spreading.

Looks like you are inventing your own limited version of what memif does.

  reply	other threads:[~2022-05-20 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  8:34 Antonio Di Bacco
2022-05-20 15:48 ` Stephen Hemminger [this message]
2022-05-21  9:42   ` Antonio Di Bacco
2022-05-23 13:16     ` Antonio Di Bacco
2022-05-25  7:30       ` Antonio Di Bacco
2022-05-25 10:55         ` Kinsella, Ray
2022-05-25 13:33           ` Antonio Di Bacco

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=20220520084843.698f04ee@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=a.dibacco.ks@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).