DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] The type string in the malloc library is unused
@ 2019-09-13 13:32 Morten Brørup
  2019-09-13 19:38 ` Alexander Pshenichnikov
       [not found] ` <CAOaVG17_bhBOfJdvHZOzoVO3t7CXCZCa7f=_Q=_Pi5jgnY3GzA@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Morten Brørup @ 2019-09-13 13:32 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: Olivier Matz, Andrew Rybchenko, dev

Hi Anatoly,

 

The functions in the DPDK malloc library takes a "type" parameter (a string, supposedly for debug purposes), but the underlying malloc_heap functions (which take the same string parameter) don't store or use this string for anything.

 

Is the intention to implement this sometime in the future, or should it be considered for removal?

 

I was originally looking for a function for my primary process to allocate a block of named memory in the huge-page area, so my secondary process could look it up and use it. And I would simply use a unique type string for this, and add an rte_malloc_lookup function. However, that obviously doesn't work when the type parameter is not used during allocation.

 

 

The simplest workaround I can come up with is using a named mempool with a single element, where this element is my memory block. I get an element from this mempool to find the address of my memory block, store the address, and put the element back in the mempool, so the secondary process can get the address the same way, i.e. by getting and putting the element back into the mempool while storing the element's address underway.

 

Any better ideas?

 

 

Med venlig hilsen / kind regards

 

Morten Brørup

CTO

 

 

SmartShare Systems A/S

Tonsbakken 16-18

DK-2740 Skovlunde

Denmark

 

Office      +45 70 20 00 93

Direct      +45 89 93 50 22

Mobile     +45 25 40 82 12

 

mb@smartsharesystems.com <mailto:mb@smartsharesystems.com> 

www.smartsharesystems.com <https://www.smartsharesystems.com/> 

 


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

* Re: [dpdk-dev] The type string in the malloc library is unused
  2019-09-13 13:32 [dpdk-dev] The type string in the malloc library is unused Morten Brørup
@ 2019-09-13 19:38 ` Alexander Pshenichnikov
  2019-09-14  7:06   ` Morten Brørup
       [not found] ` <CAOaVG17_bhBOfJdvHZOzoVO3t7CXCZCa7f=_Q=_Pi5jgnY3GzA@mail.gmail.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Pshenichnikov @ 2019-09-13 19:38 UTC (permalink / raw)
  To: Morten Brørup; +Cc: Anatoly Burakov, Olivier Matz, Andrew Rybchenko, dev

Hi Morten,

Look rte_memzone_reserve/rte_memzone_lookup



On Fri, Sep 13, 2019 at 4:32 PM Morten Brørup <mb@smartsharesystems.com> wrote:
>
> Hi Anatoly,
>
>
>
> The functions in the DPDK malloc library takes a "type" parameter (a string, supposedly for debug purposes), but the underlying malloc_heap functions (which take the same string parameter) don't store or use this string for anything.
>
>
>
> Is the intention to implement this sometime in the future, or should it be considered for removal?
>
>
>
> I was originally looking for a function for my primary process to allocate a block of named memory in the huge-page area, so my secondary process could look it up and use it. And I would simply use a unique type string for this, and add an rte_malloc_lookup function. However, that obviously doesn't work when the type parameter is not used during allocation.
>
>
>
>
>
> The simplest workaround I can come up with is using a named mempool with a single element, where this element is my memory block. I get an element from this mempool to find the address of my memory block, store the address, and put the element back in the mempool, so the secondary process can get the address the same way, i.e. by getting and putting the element back into the mempool while storing the element's address underway.
>
>
>
> Any better ideas?
>
>
>
>
>
> Med venlig hilsen / kind regards
>
>
>
> Morten Brørup
>
> CTO
>
>
>
>
>
> SmartShare Systems A/S
>
> Tonsbakken 16-18
>
> DK-2740 Skovlunde
>
> Denmark
>
>
>
> Office      +45 70 20 00 93
>
> Direct      +45 89 93 50 22
>
> Mobile     +45 25 40 82 12
>
>
>
> mb@smartsharesystems.com <mailto:mb@smartsharesystems.com>
>
> www.smartsharesystems.com <https://www.smartsharesystems.com/>
>
>
>

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

* Re: [dpdk-dev] The type string in the malloc library is unused
  2019-09-13 19:38 ` Alexander Pshenichnikov
@ 2019-09-14  7:06   ` Morten Brørup
  0 siblings, 0 replies; 4+ messages in thread
From: Morten Brørup @ 2019-09-14  7:06 UTC (permalink / raw)
  To: Alexander Pshenichnikov
  Cc: Anatoly Burakov, Olivier Matz, Andrew Rybchenko, dev

Hi Alexander,

That was exactly what I was looking for, thanks!

Med venlig hilsen / kind regards
- Morten Brørup

> -----Original Message-----
> From: Alexander Pshenichnikov [mailto:apshen@gmail.com]
> Sent: Friday, September 13, 2019 9:38 PM
> To: Morten Brørup
> Cc: Anatoly Burakov; Olivier Matz; Andrew Rybchenko; dev@dpdk.org
> Subject: Re: [dpdk-dev] The type string in the malloc library is unused
> 
> Hi Morten,
> 
> Look rte_memzone_reserve/rte_memzone_lookup
> 
> 
> 
> On Fri, Sep 13, 2019 at 4:32 PM Morten Brørup <mb@smartsharesystems.com>
> wrote:
> >
> > Hi Anatoly,
> >
> >
> >
> > The functions in the DPDK malloc library takes a "type" parameter (a
> string, supposedly for debug purposes), but the underlying malloc_heap
> functions (which take the same string parameter) don't store or use this
> string for anything.
> >
> >
> >
> > Is the intention to implement this sometime in the future, or should it
> be considered for removal?
> >
> >
> >
> > I was originally looking for a function for my primary process to
> allocate a block of named memory in the huge-page area, so my secondary
> process could look it up and use it. And I would simply use a unique type
> string for this, and add an rte_malloc_lookup function. However, that
> obviously doesn't work when the type parameter is not used during
> allocation.
> >
> >
> >
> >
> >
> > The simplest workaround I can come up with is using a named mempool with
> a single element, where this element is my memory block. I get an element
> from this mempool to find the address of my memory block, store the
> address, and put the element back in the mempool, so the secondary process
> can get the address the same way, i.e. by getting and putting the element
> back into the mempool while storing the element's address underway.
> >
> >
> >
> > Any better ideas?
> >
> >
> >
> >
> >
> > Med venlig hilsen / kind regards
> >
> >
> >
> > Morten Brørup
> >
> > CTO
> >
> >
> >
> >
> >
> > SmartShare Systems A/S
> >
> > Tonsbakken 16-18
> >
> > DK-2740 Skovlunde
> >
> > Denmark
> >
> >
> >
> > Office      +45 70 20 00 93
> >
> > Direct      +45 89 93 50 22
> >
> > Mobile     +45 25 40 82 12
> >
> >
> >
> > mb@smartsharesystems.com <mailto:mb@smartsharesystems.com>
> >
> > www.smartsharesystems.com <https://www.smartsharesystems.com/>
> >
> >
> >


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

* Re: [dpdk-dev] The type string in the malloc library is unused
       [not found] ` <CAOaVG17_bhBOfJdvHZOzoVO3t7CXCZCa7f=_Q=_Pi5jgnY3GzA@mail.gmail.com>
@ 2019-09-14  8:29   ` Morten Brørup
  0 siblings, 0 replies; 4+ messages in thread
From: Morten Brørup @ 2019-09-14  8:29 UTC (permalink / raw)
  To: Stephen Hemminger, Anatoly Burakov; +Cc: Olivier Matz, Andrew Rybchenko, dev

I tend to agree with Stephen here, although it will break the API/ABI.

 

Another argument supporting its removal is the fact that it has remained non-implemented for many years, so a function for dumping information about rte_malloc'ed memory using the "type" string for debugging purposes has apparently not been in very high demand.

 

Med venlig hilsen / kind regards

- Morten Brørup

 

From: Stephen Hemminger [mailto:stephen@networkplumber.org] 
Sent: Saturday, September 14, 2019 8:24 AM
To: Morten Brørup
Subject: Re: [dpdk-dev] The type string in the malloc library is unused

 

I would vote for removing it.

It is too late to implement it without breaking existing code.

 

 

On Fri, Sep 13, 2019, 3:32 PM Morten Brørup <mb@smartsharesystems.com> wrote:

	Hi Anatoly,
	
	
	
	The functions in the DPDK malloc library takes a "type" parameter (a string, supposedly for debug purposes), but the underlying malloc_heap functions (which take the same string parameter) don't store or use this string for anything.
	
	
	
	Is the intention to implement this sometime in the future, or should it be considered for removal?
	
	
	


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

end of thread, other threads:[~2019-09-14 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 13:32 [dpdk-dev] The type string in the malloc library is unused Morten Brørup
2019-09-13 19:38 ` Alexander Pshenichnikov
2019-09-14  7:06   ` Morten Brørup
     [not found] ` <CAOaVG17_bhBOfJdvHZOzoVO3t7CXCZCa7f=_Q=_Pi5jgnY3GzA@mail.gmail.com>
2019-09-14  8:29   ` Morten Brørup

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