DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
       [not found] <1470871839.40000.48.camel@intel.com>
@ 2016-08-11  7:05 ` Thomas Monjalon
  2016-08-15 17:23   ` Harris, James R
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2016-08-11  7:05 UTC (permalink / raw)
  To: users, dev, Gonzalez Monroy, Sergio, bruce.richardson; +Cc: Verkamp, Daniel

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  2016-08-11  7:05 ` [dpdk-dev] [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
  0 siblings, 1 reply; 8+ messages in thread
From: Harris, James R @ 2016-08-15 17:23 UTC (permalink / raw)
  To: Thomas Monjalon, users, dev, Gonzalez Monroy, Sergio, Richardson, Bruce
  Cc: Verkamp, Daniel



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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  2016-08-15 17:23   ` Harris, James R
@ 2016-08-16  7:36     ` Sergio Gonzalez Monroy
  2016-08-16 22:54       ` Harris, James R
  0 siblings, 1 reply; 8+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-08-16  7:36 UTC (permalink / raw)
  To: Harris, James R, Thomas Monjalon, users, dev, Richardson, Bruce
  Cc: Verkamp, Daniel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  2016-08-16  7:36     ` Sergio Gonzalez Monroy
@ 2016-08-16 22:54       ` Harris, James R
  0 siblings, 0 replies; 8+ messages in thread
From: Harris, James R @ 2016-08-16 22:54 UTC (permalink / raw)
  To: Gonzalez Monroy, Sergio, Thomas Monjalon, users, dev, Richardson, Bruce
  Cc: Verkamp, Daniel



> -----Original Message-----
> From: Gonzalez Monroy, Sergio
> Sent: Tuesday, August 16, 2016 12:37 AM
> To: Harris, James R; Thomas Monjalon; users@dpdk.org; dev@dpdk.org;
> Richardson, Bruce
> Cc: Verkamp, Daniel
> Subject: Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed
> memory on FreeBSD
> 
> On 15/08/2016 18:23, Harris, James R wrote:
> >

<snip>

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

Correct - it works OK the first time.  The problem only occurs if you run the app
more than once (unless you unload and reload contigmem before running the
app a second time).

-Jim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  2016-11-04 16:38 ` Sergio Gonzalez Monroy
  2016-11-04 16:43   ` Lewis Donzis
@ 2016-11-04 20:10   ` Lewis Donzis
  1 sibling, 0 replies; 8+ messages in thread
From: Lewis Donzis @ 2016-11-04 20:10 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev


> On Nov 4, 2016, at 11:38 AM, Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> wrote:
> It should have been fixed in 16.07.1.
> http://dpdk.org/browse/dpdk-stable/commit/?id=82f931805506efbb8b5046e9045bec8f04bbabf6

Hi, Sergio.

We confirmed that it works perfectly with 16.07.1 with the new contigmem driver.

Thanks!
lew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  2016-11-04 16:38 ` Sergio Gonzalez Monroy
@ 2016-11-04 16:43   ` Lewis Donzis
  2016-11-04 20:10   ` Lewis Donzis
  1 sibling, 0 replies; 8+ messages in thread
From: Lewis Donzis @ 2016-11-04 16:43 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev


> On Nov 4, 2016, at 11:38 AM, Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> wrote:
> 
> On 03/11/2016 20:04, Lewis Donzis wrote:
>> I’m curious about how/whether this got resolved.  The 16.07.1 code doesn’t appear to have this fixed.
>> 
>> Is it still forthcoming?
>> 
>> Thanks,
>> lew
> 
> It should have been fixed in 16.07.1.
> http://dpdk.org/browse/dpdk-stable/commit/?id=82f931805506efbb8b5046e9045bec8f04bbabf6
> 
> Do you have an easy test to reproduce? can you reproduce it with any of the app/examples?

Oh, sorry, I was looking at the rte_zmalloc() code, assuming it would be changed there, but it looks like the commit was to change contigmem instead, which seems perfectly logical and reasonable.

It’s entirely possible that the folks here who tested 16.07.1 forgot to replace the contigmem driver, so perhaps that is the problem.

We’ll check it out and report back.

Thanks!
lew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
  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
  0 siblings, 2 replies; 8+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-11-04 16:38 UTC (permalink / raw)
  To: Lewis Donzis, dev

On 03/11/2016 20:04, Lewis Donzis wrote:
> I’m curious about how/whether this got resolved.  The 16.07.1 code doesn’t appear to have this fixed.
>
> Is it still forthcoming?
>
> Thanks,
> lew

It should have been fixed in 16.07.1.
http://dpdk.org/browse/dpdk-stable/commit/?id=82f931805506efbb8b5046e9045bec8f04bbabf6

Do you have an easy test to reproduce? can you reproduce it with any of 
the app/examples?

Sergio

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
@ 2016-11-03 20:04 Lewis Donzis
  2016-11-04 16:38 ` Sergio Gonzalez Monroy
  0 siblings, 1 reply; 8+ messages in thread
From: Lewis Donzis @ 2016-11-03 20:04 UTC (permalink / raw)
  To: dev

I’m curious about how/whether this got resolved.  The 16.07.1 code doesn’t appear to have this fixed.

Is it still forthcoming?

Thanks,
lew

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-04 20:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1470871839.40000.48.camel@intel.com>
2016-08-11  7:05 ` [dpdk-dev] [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
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

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