DPDK usage discussions
 help / color / mirror / Atom feed
From: Byonggon Chun <byonggonchun@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Should ''shmget" not be used to consume hugepages in DPDK?
Date: Fri, 20 Dec 2019 01:23:50 +0900	[thread overview]
Message-ID: <CACh8f0M_W9NvAgqp-vc-KR57hXO6=tYeWbfqQNG+NytYxp6AsQ@mail.gmail.com> (raw)

Hi all.
I'm Kubernetes contributors and I'm working to make container isolation of
hugepages that allows us to set hugepages limit per container cgroup.
(At this point, limits are set on pod level cgroup even though we asked
hugepages as the container level resource)

I tore down testPMD and some parts of DPDK lib and I got a question after i
found there is no usage of "shmget" in DPDK.

My question is that Should "shmget" not be used to consume hugepages in
DPDK?
And here is following questions:
1) If we don't have to use "shmget", Why? Does it affect performance?
2) If I use "shmget" to get hugepages, should I call "mlock" syscall for it?

For more details, as I know there are three ways to consume hugepages in
kubernetes.
1) shmget with SHM_HUGETLB
2) mmap with hugetlbs filebacking
3) mmap with MAP_ANONYMOUS | MAP_HUGETLB

And I found that testPMD calls mlock syscall when it maps an anonymous
hugepages or external allocated hugepages.
https://github.com/DPDK/dpdk/blob/924e55fb340623f03fdf2ff7fbcfd78819d1db25/app/test-pmd/testpmd.c#L896
https://github.com/DPDK/dpdk/blob/924e55fb340623f03fdf2ff7fbcfd78819d1db25/app/test-pmd/testpmd.c#L916

Thanks.

             reply	other threads:[~2019-12-19 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 16:23 Byonggon Chun [this message]
2019-12-19 21:06 ` Stephen Hemminger
2019-12-20 12:42   ` Byonggon Chun
2019-12-22 15:33     ` Byonggon Chun
2020-02-06 13:53       ` [dpdk-users] [dpdk-dev] " Burakov, Anatoly

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='CACh8f0M_W9NvAgqp-vc-KR57hXO6=tYeWbfqQNG+NytYxp6AsQ@mail.gmail.com' \
    --to=byonggonchun@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).