From: =?gb18030?B?sNezpMP0?= <912873551@qq.com>
To: =?gb18030?B?SmltIFRob21wc29u?= <jim@netgate.com>
Cc: =?gb18030?B?ZGV2?= <dev@dpdk.org>
Subject: [dpdk-dev] =?gb18030?b?u9i4tKO6ICBBYm91dCB0aGUgc2hhcmVkIGZsb2Nr?= =?gb18030?q?_for_hugepage_files?=
Date: Tue, 12 Sep 2017 11:41:53 +0800 [thread overview]
Message-ID: <tencent_FC289A9347E94187C113AA4D889A13644C05@qq.com> (raw)
In-Reply-To: <F05DB73D-ED69-4261-B154-95910A0F1C3E@netgate.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1900 bytes --]
Hi Jim,
Thank you for reply, i understand it, but i still have two doubts.
1) if i have > 1 DPDK application on a machine, i can use the parameter "--file-prefix" to distinguish, it can work even if have not flock.
2) If I understand correctly, in the "map_all_hugepages()", after making the shared flock, close(fd), that is to free the flock. Then, in the "clear_hugedir()", it equal to have not flock ?
------------------ ÔʼÓʼþ ------------------
·¢¼þÈË: "Jim Thompson";<jim@netgate.com>;
·¢ËÍʱ¼ä: 2017Äê9ÔÂ12ÈÕ(ÐÇÆÚ¶þ) ÖÐÎç11:10
ÊÕ¼þÈË: "°×³¤Ãô"<912873551@qq.com>;
³ËÍ: "dev"<dev@dpdk.org>;
Ö÷Ìâ: Re: [dpdk-dev] About the shared flock for hugepage files
Bakari,
This is so you can have > 1 DPDK application on a machine and they won't use each other's hugepages.
See, for example the comments in clear_hugedir()
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c#n198
Jim
On Sep 11, 2017, at 9:16 PM, °×³¤Ãô <912873551@qq.com> wrote:
Hi, everyone,
I'm a developer from china, now i have a problem is about the shared flock for hugepage files in the function of "map_all_hugepages()".
as follows:
---------------------------------------------------------------------------------------------------
/* set shared flock on the file. */
if (flock(fd, LOCK_SH | LOCK_NB) == -1) {
RTE_LOG(DEBUG, EAL, "%s(): Locking file failed:%s \n", __func__, strerror(errno));
close(fd);
return i;
}
close(fd);
--------------------------------------------------------------------------------------------------
there, it gives a shared flock to each hugepage file in /mnt/huge, and close it right away.
it makes me puzzled. Why? What doing that is for?
I'm looking forward to your reply, thank you very much.
best regards,
Bakari.
next prev parent reply other threads:[~2017-09-12 3:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 2:16 [dpdk-dev] About the shared flock for hugepage files =?gb18030?B?sNezpMP0?=
2017-09-12 3:10 ` Jim Thompson
2017-09-12 3:41 ` =?gb18030?B?sNezpMP0?= [this message]
2017-09-19 14:05 ` [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=tencent_FC289A9347E94187C113AA4D889A13644C05@qq.com \
--to=912873551@qq.com \
--cc=dev@dpdk.org \
--cc=jim@netgate.com \
/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).