DPDK usage discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Sudhakar Vajha <sudhakar.vajha@oracle.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: KASLR enabled in Linux Kernel
Date: Wed, 24 Jan 2024 00:00:23 +0300	[thread overview]
Message-ID: <20240124000023.73dacba5@sovereign> (raw)
In-Reply-To: <PH0PR10MB472839FEC31AB6CC8352C5F0EA752@PH0PR10MB4728.namprd10.prod.outlook.com>

Hi Sudhakar,

2024-01-22 09:58 (UTC+0000), Sudhakar Vajha:
[...]
> During SBC 6400 initialization, requesting the system to create 64 huge
> pages of 1GB size.

Are you using <rte_memzone.h> API, possibly via <rte_mempool.h> functions?
What are the exact request parameters: size, alignment, flags?

> DPDK is leaving a space for one segment in the memory segment list and try
> to remap the huge pages into the rest of the segments in the memory segment
> list.

Can you please provide logs or debug prints
to confirm this is what's happening?

> Note: Why DPDK is leaving a space for a hole in a memory segment list?
> 
> Basically, DPDK is leaving the space to know how many segments there are in
> order to map all pages into one address space, and leave appropriate holes
> between segments so that rte_malloc does not concatenate them into one big
> segment. But in this case, all the 64 pages are belongs to one address
> space and leaving space for a hole is not required.

Note: you seem to use the term "address space"
for what is called DPDK allocator element (struct malloc_elem).
At the same time, rte_malloc doesn't have logic to leave holes,
as one element is allowed to contain memory from pages
that are not physically contiguous.
There is logic like this with --legacy-mem EAL option
(page ranges that are not pysically contiguous
are mapped to virtual addresses that are not contiguous as well),
but from you logs it seems that you are not using it.

> The following are my queries:
> 
> 1. Why the space is leaving in the memseg list? And what is the
> significance of the hole?

If indeed using memzones, the following might happen.
Memzone is internally a regular element to the DPDK allocator.
It consists of the requested amount of usable memory, plus a header of 128B
(also a trailer when RTE_MALLOC_DEBUG is defined).
It is thus impossible to have all 64 GB of memory as usable via DPDK,
because some little part of it will be internally used for element headers.
Much more space may be lost due to alignment.
Maybe aligning multiple times when ASLR is enabled accumulates too much loss.

> 2. Can I scale up the size of the memory segment list to greater than the 64?

You have to rebuild DPDK with RTE_MAX_MEM_MB_PER_TYPE and
RTE_MAX_MEM_MB_PER_LIST changed as needed.

      reply	other threads:[~2024-01-23 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  9:58 Sudhakar Vajha
2024-01-23 21:00 ` Dmitry Kozlyuk [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=20240124000023.73dacba5@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=sudhakar.vajha@oracle.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).