DPDK usage discussions
 help / color / mirror / Atom feed
From: "Harris, James R" <james.r.harris@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>,
	"users@dpdk.org" <users@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>,
	"Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "Verkamp, Daniel" <daniel.verkamp@intel.com>
Subject: Re: [dpdk-users] [dpdk-dev] rte_zmalloc() returning non-zeroed	memory on FreeBSD
Date: Mon, 15 Aug 2016 17:23:27 +0000	[thread overview]
Message-ID: <A35C21583F92CE4D8ADBF9D61694E910216BF49B@FMSMSX105.amr.corp.intel.com> (raw)
In-Reply-To: <1549431.MJntLMElOg@xps13>



> -----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.

  reply	other threads:[~2016-08-15 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 23:30 [dpdk-users] " Verkamp, Daniel
2016-08-10 23:39 ` Verkamp, Daniel
2016-08-11  7:05 ` Thomas Monjalon
2016-08-15 17:23   ` Harris, James R [this message]
     [not found]     ` <8b8e180e-a996-ef6e-cbf8-23028a194224@intel.com>
2016-08-16 22:54       ` [dpdk-users] [dpdk-dev] " 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=A35C21583F92CE4D8ADBF9D61694E910216BF49B@FMSMSX105.amr.corp.intel.com \
    --to=james.r.harris@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=daniel.verkamp@intel.com \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@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 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).