DPDK usage discussions
 help / color / mirror / Atom feed
From: "Nick Tian" <nick.tian@longsailingsemi.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: About memory coherency
Date: Tue, 09 Aug 2022 10:54:37 +0800	[thread overview]
Message-ID: <3a78c1df-8c0f-4d99-9447-c58fd4592625.nick.tian@longsailingsemi.com> (raw)
In-Reply-To: <a509f1dc-2577-457b-8971-825d8ec79329.nick.tian@longsailingsemi.com>

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


Hi
I am confusing about the "no-huge" option of DPDK 21.11.
The dpdk usage said: --no-huge:Use malloc instead of hugetlbfs.
But when I check the EAL source code, I found some code piece like this:
It's look like "no-huge" option will lead dpdk use memfd_create-->ftruncate-->mmap to reserve memory
and then provide to application with rte_malloc.
Am I right?
If so, what the "malloc" in "use malloc instead of hugelbfs" refer to?

EAL_memory.c
static int eal_legacy_hugepage_init(void){
....
 if (internal_conf->no_hugetlbfs) {
....
#ifdef MEMFD_SUPPORTED
  /* create a memfd and store it in the segment fd table */
  memfd = memfd_create("nohuge", 0);
......
   /* we got an fd - now resize it */
   if (ftruncate(memfd, internal_conf->memory) < 0) {
.....
    fd = memfd;
    flags = MAP_SHARED;   }
....
  prealloc_addr = msl->base_va;
  addr = mmap(prealloc_addr, mem_sz, PROT_READ | PROT_WRITE,
    flags | MAP_FIXED, fd, 0);
...



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

  reply	other threads:[~2022-08-09  2:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09  2:38 Nick Tian
2022-08-09  2:54 ` Nick Tian [this message]
2022-08-09  9:04   ` Kinsella, Ray
2022-08-09  9:25     ` Burakov, Anatoly
2022-08-09  9:41       ` 回复:RE: " Nick Tian
2022-08-09  9:59         ` Burakov, Anatoly
2022-08-09 11:32         ` 回复:回复:RE: " Nick Tian
2022-08-09 11:44           ` Kinsella, Ray
2022-08-09 11:57             ` Nick Tian
2022-08-09 12:16             ` 回复:回复:RE: " Burakov, Anatoly
2022-08-09 13:05               ` 回复:About memory cohere =?utf-8?Q?ncy ‪nick.tian
2022-08-09 13:13                 ` Burakov, Anatoly
2022-08-09 13:16               ` 回复:回复:RE: About memory coherency Jerin Jacob Kollanukkaran

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=3a78c1df-8c0f-4d99-9447-c58fd4592625.nick.tian@longsailingsemi.com \
    --to=nick.tian@longsailingsemi.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).