From: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
To: "Harris, James R" <james.r.harris@intel.com>,
Thomas Monjalon <thomas.monjalon@6wind.com>,
"users@dpdk.org" <users@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>,
"Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "Verkamp, Daniel" <daniel.verkamp@intel.com>
Subject: Re: [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
Date: Tue, 16 Aug 2016 08:36:43 +0100 [thread overview]
Message-ID: <8b8e180e-a996-ef6e-cbf8-23028a194224@intel.com> (raw)
In-Reply-To: <A35C21583F92CE4D8ADBF9D61694E910216BF49B@FMSMSX105.amr.corp.intel.com>
On 15/08/2016 18:23, Harris, James R wrote:
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
>> Sent: Thursday, August 11, 2016 12:05 AM
>> To: users@dpdk.org; dev@dpdk.org; Gonzalez Monroy, Sergio; Richardson,
>> Bruce
>> Cc: Verkamp, Daniel
>> Subject: Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed
>> memory on FreeBSD
>>
>> 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.
> The problem is that the FreeBSD contigmem driver does not re-zero the huge
> pages each time they are mmap'd - they are only zeroed when contigmem
> initially loads. I will push a patch for this shortly.
So that is the case where we run the app more than once, right?
I missed that, I only ran it once.
Sergio
next prev parent reply other threads:[~2016-08-16 7:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1470871839.40000.48.camel@intel.com>
2016-08-11 7:05 ` [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD Thomas Monjalon
2016-08-15 17:23 ` Harris, James R
2016-08-16 7:36 ` Sergio Gonzalez Monroy [this message]
2016-08-16 22:54 ` Harris, James R
2016-11-03 20:04 Lewis Donzis
2016-11-04 16:38 ` Sergio Gonzalez Monroy
2016-11-04 16:43 ` Lewis Donzis
2016-11-04 20:10 ` Lewis Donzis
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=8b8e180e-a996-ef6e-cbf8-23028a194224@intel.com \
--to=sergio.gonzalez.monroy@intel.com \
--cc=bruce.richardson@intel.com \
--cc=daniel.verkamp@intel.com \
--cc=dev@dpdk.org \
--cc=james.r.harris@intel.com \
--cc=thomas.monjalon@6wind.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.