From: Fengkai Sun <qcloud1014@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Secondary process cannot call functions on hugepages
Date: Tue, 20 Jul 2021 17:28:59 +0800 [thread overview]
Message-ID: <CAF6YOcPtZqRvkEtTYugjV0LtV-tNd55B4VWq--zePa8p77XoPg@mail.gmail.com> (raw)
Hi list,
Recently I read about the multi-process support of dpdk and found the
feature of keeping the hugepage mappings between primary and secondary
processes very interesting.
Therefore, I made the following experiments:
1. I modify the glibc to make dlopen() map shared libraries on hugepages.
This is done by changing the underlying mapping strategy from mmap to pread.
2. I allocate a continuous address by rte_malloc(), and instruct dlopen()
to map a shared library there, let's call it lib1.so.
3. After dlopen() succeeds, I use dlsym() in the primary process to locate
the global variables and functions in lib1.so, and it turns out they are
correctly mapped and functions can be called without a problem.
4. Because hugepage seems to get away with the effect of ASLR, I record the
address of those global variables and functions in lib1.so, and verify them
in the secondary process.
The secondary can access the global variables at the same address, but
when it tries to call the function, a segfault occurs.
5. I try to use dlopen() with the same arguments as the primary process in
the secondary process, but it just gives a segfault.
Unfortunately, gdb also gives a segfault when the program starts up, so I
cannot give some useful debug info.
My question is, does dpdk permit functions to be loaded on hugepages and be
called by multiple functions? Though the two processes see the exact same
content on the hugepage, the secondary just cannot call the function on it.
Any intuitive advice is appreciated.
--
Best,
Fengkai
next reply other threads:[~2021-07-20 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 9:28 Fengkai Sun [this message]
2021-07-20 15:44 ` Stephen Hemminger
2021-07-21 2:34 ` Fengkai Sun
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=CAF6YOcPtZqRvkEtTYugjV0LtV-tNd55B4VWq--zePa8p77XoPg@mail.gmail.com \
--to=qcloud1014@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).