From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: users@dpdk.org, dev@dpdk.org, "Gonzalez Monroy,
Sergio" <sergio.gonzalez.monroy@intel.com>,
bruce.richardson@intel.com
Cc: "Verkamp, Daniel" <daniel.verkamp@intel.com>
Subject: Re: [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
Date: Thu, 11 Aug 2016 09:05:25 +0200 [thread overview]
Message-ID: <1549431.MJntLMElOg@xps13> (raw)
In-Reply-To: <1470871839.40000.48.camel@intel.com>
Hi,
2016-08-10 23:30, Verkamp, Daniel:
> It seems that with DPDK 16.07, rte_zmalloc() and related functions no
> longer return zeroed memory reliably on FreeBSD.
>
> I notice that commit b78c9175118f7d61022ddc5c62ce54a1bd73cea5 ("mem: do
> not zero out memory on zmalloc") removed the explicit memset() that used
> to ensure the buffer was zeroed; its log message says:
>
> "Zeroing out memory on rte_zmalloc_socket is not required anymore since
> all allocated memory is already zeroed."
On Linux, the memory is zeroed by the kernel.
Then the zero value is maintained in the rte_malloc pool by rte_free.
> However, I don't see how this is guaranteed (at least for FreeBSD), and
> it is not true in practice. I've attached a minimized reproducer program -
> running it twice in a row fails reliably for me.
>
> Is there a missing step in FreeBSD, or is it a more general problem for
> other platforms?
I guess the initial value from the kernel has been verified only on Linux.
We could re-add a memset for FreeBSD.
next prev parent reply other threads:[~2016-08-11 7:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 23:30 Verkamp, Daniel
2016-08-10 23:39 ` Verkamp, Daniel
2016-08-11 7:05 ` Thomas Monjalon [this message]
2016-08-15 17:23 ` [dpdk-users] [dpdk-dev] " Harris, James R
[not found] ` <8b8e180e-a996-ef6e-cbf8-23028a194224@intel.com>
2016-08-16 22:54 ` Harris, James R
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=1549431.MJntLMElOg@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=bruce.richardson@intel.com \
--cc=daniel.verkamp@intel.com \
--cc=dev@dpdk.org \
--cc=sergio.gonzalez.monroy@intel.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).