DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] NUMA node/socket
@ 2021-07-04  1:38 Thomas Monjalon
  2021-07-04  1:53 ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2021-07-04  1:38 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, andrew.rybchenko, keesang.song, anatoly.burakov,
	david.marchand, bruce.richardson, David Christensen

There are some mix between NUMA node and socket IDs in DPDK.
Examples:
	* rte_eth_dev_socket_id() returns the NUMA node.
	* rte_malloc use sockets to allocate the memory

Is it critical?



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

* Re: [dpdk-dev] NUMA node/socket
  2021-07-04  1:38 [dpdk-dev] NUMA node/socket Thomas Monjalon
@ 2021-07-04  1:53 ` Thomas Monjalon
  2021-07-04  8:27   ` Andrew Rybchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2021-07-04  1:53 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, andrew.rybchenko, keesang.song, anatoly.burakov,
	david.marchand, bruce.richardson, David Christensen,
	dmitry.kozliuk, ruifeng.wang

04/07/2021 03:38, Thomas Monjalon:
> There are some mix between NUMA node and socket IDs in DPDK.
> Examples:
> 	* rte_eth_dev_socket_id() returns the NUMA node.
> 	* rte_malloc use sockets to allocate the memory
> 
> Is it critical?

There is a function, implemented for Windows only,
which distinguishes clearly node and socket
but it assumes there is only 1 node per socket:

unsigned int
eal_socket_numa_node(unsigned int socket_id)
{
    return cpu_map.sockets[socket_id].node_id;
}

Reminder: AMD can be configured to have multiple nodes per socket.



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

* Re: [dpdk-dev] NUMA node/socket
  2021-07-04  1:53 ` Thomas Monjalon
@ 2021-07-04  8:27   ` Andrew Rybchenko
  2021-07-04  9:28     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2021-07-04  8:27 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: ferruh.yigit, keesang.song, anatoly.burakov, david.marchand,
	bruce.richardson, David Christensen, dmitry.kozliuk,
	ruifeng.wang

On 7/4/21 4:53 AM, Thomas Monjalon wrote:
> 04/07/2021 03:38, Thomas Monjalon:
>> There are some mix between NUMA node and socket IDs in DPDK.
>> Examples:
>> 	* rte_eth_dev_socket_id() returns the NUMA node.
>> 	* rte_malloc use sockets to allocate the memory
>>
>> Is it critical?
> 
> There is a function, implemented for Windows only,
> which distinguishes clearly node and socket
> but it assumes there is only 1 node per socket:
> 
> unsigned int
> eal_socket_numa_node(unsigned int socket_id)
> {
>     return cpu_map.sockets[socket_id].node_id;
> }
> 
> Reminder: AMD can be configured to have multiple nodes per socket.

Taking the reminder into account the topic definitely
requires improvements.

I apologize for my ignorance, but
Is socket ID really interesting to anybody in DPDK?
If no, we should just clarify terminology and switch
to NUMA node everywhere.

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

* Re: [dpdk-dev] NUMA node/socket
  2021-07-04  8:27   ` Andrew Rybchenko
@ 2021-07-04  9:28     ` Thomas Monjalon
  2021-07-04 16:18       ` Stephen Hemminger
  2021-07-04 16:27       ` Dmitry Kozlyuk
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-07-04  9:28 UTC (permalink / raw)
  To: dev, Andrew Rybchenko
  Cc: ferruh.yigit, keesang.song, anatoly.burakov, david.marchand,
	bruce.richardson, David Christensen, dmitry.kozliuk,
	ruifeng.wang

04/07/2021 10:27, Andrew Rybchenko:
> On 7/4/21 4:53 AM, Thomas Monjalon wrote:
> > 04/07/2021 03:38, Thomas Monjalon:
> >> There are some mix between NUMA node and socket IDs in DPDK.
> >> Examples:
> >> 	* rte_eth_dev_socket_id() returns the NUMA node.
> >> 	* rte_malloc use sockets to allocate the memory
> >>
> >> Is it critical?
> > 
> > There is a function, implemented for Windows only,
> > which distinguishes clearly node and socket
> > but it assumes there is only 1 node per socket:
> > 
> > unsigned int
> > eal_socket_numa_node(unsigned int socket_id)
> > {
> >     return cpu_map.sockets[socket_id].node_id;
> > }
> > 
> > Reminder: AMD can be configured to have multiple nodes per socket.
> 
> Taking the reminder into account the topic definitely
> requires improvements.
> 
> I apologize for my ignorance, but
> Is socket ID really interesting to anybody in DPDK?

I think the socket ID might be interesting for the threads,
but not for memory or devices.

> If no, we should just clarify terminology and switch
> to NUMA node everywhere.

I have the same opinion as Andrew.
If socket ID is required, it could be deduced from the NUMA node
or from the CPU core.



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

* Re: [dpdk-dev] NUMA node/socket
  2021-07-04  9:28     ` Thomas Monjalon
@ 2021-07-04 16:18       ` Stephen Hemminger
  2021-07-04 16:27       ` Dmitry Kozlyuk
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2021-07-04 16:18 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Andrew Rybchenko, ferruh.yigit, keesang.song,
	anatoly.burakov, david.marchand, bruce.richardson,
	David Christensen, dmitry.kozliuk, ruifeng.wang

On Sun, 04 Jul 2021 11:28:23 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 04/07/2021 10:27, Andrew Rybchenko:
> > On 7/4/21 4:53 AM, Thomas Monjalon wrote:  
> > > 04/07/2021 03:38, Thomas Monjalon:  
> > >> There are some mix between NUMA node and socket IDs in DPDK.
> > >> Examples:
> > >> 	* rte_eth_dev_socket_id() returns the NUMA node.
> > >> 	* rte_malloc use sockets to allocate the memory
> > >>
> > >> Is it critical?  
> > > 
> > > There is a function, implemented for Windows only,
> > > which distinguishes clearly node and socket
> > > but it assumes there is only 1 node per socket:
> > > 
> > > unsigned int
> > > eal_socket_numa_node(unsigned int socket_id)
> > > {
> > >     return cpu_map.sockets[socket_id].node_id;
> > > }
> > > 
> > > Reminder: AMD can be configured to have multiple nodes per socket.  
> > 
> > Taking the reminder into account the topic definitely
> > requires improvements.
> > 
> > I apologize for my ignorance, but
> > Is socket ID really interesting to anybody in DPDK?  
> 
> I think the socket ID might be interesting for the threads,
> but not for memory or devices.
> 
> > If no, we should just clarify terminology and switch
> > to NUMA node everywhere.  
> 
> I have the same opinion as Andrew.
> If socket ID is required, it could be deduced from the NUMA node
> or from the CPU core.
> 
> 

Agree that NUMA node should be used everywhere.
There can be some confusion because some architectures define NUMA
for lcore's that have slower interconnect even if they are on the same chip.
Also Dell used to have different terminology for socket number on some machines.
The socket id reported by BIOS started with 1!

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

* Re: [dpdk-dev] NUMA node/socket
  2021-07-04  9:28     ` Thomas Monjalon
  2021-07-04 16:18       ` Stephen Hemminger
@ 2021-07-04 16:27       ` Dmitry Kozlyuk
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Kozlyuk @ 2021-07-04 16:27 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Andrew Rybchenko, ferruh.yigit, keesang.song,
	anatoly.burakov, david.marchand, bruce.richardson,
	David Christensen, ruifeng.wang

2021-07-04 11:28 (UTC+0200), Thomas Monjalon:
> 04/07/2021 10:27, Andrew Rybchenko:
> > On 7/4/21 4:53 AM, Thomas Monjalon wrote:  
> > > 04/07/2021 03:38, Thomas Monjalon:  
> > >> There are some mix between NUMA node and socket IDs in DPDK.
> > >> Examples:
> > >> 	* rte_eth_dev_socket_id() returns the NUMA node.
> > >> 	* rte_malloc use sockets to allocate the memory
> > >>
> > >> Is it critical?  
> > > 
> > > There is a function, implemented for Windows only,
> > > which distinguishes clearly node and socket
> > > but it assumes there is only 1 node per socket:
> > > 
> > > unsigned int
> > > eal_socket_numa_node(unsigned int socket_id)
> > > {
> > >     return cpu_map.sockets[socket_id].node_id;
> > > }
> > > 
> > > Reminder: AMD can be configured to have multiple nodes per socket.
> >
> > Taking the reminder into account the topic definitely
> > requires improvements.
> > 
> > I apologize for my ignorance, but
> > Is socket ID really interesting to anybody in DPDK?  
> 
> I think the socket ID might be interesting for the threads,
> but not for memory or devices.
> 
> > If no, we should just clarify terminology and switch
> > to NUMA node everywhere.  
> 
> I have the same opinion as Andrew.
> If socket ID is required, it could be deduced from the NUMA node
> or from the CPU core.

I agree with renaming too.
Everywhere in DPDK "socket ID" really means "NUMA node".

I don't see how exactly socket ID can be deduced from NUMA node or CPU core
(assuming rte_socket_id becomes rte_numa_node_id), but I also can't imagine
why an app would need it. EAL could use NUMA distance info for better memory
management: currently SOCKET_ID_ANY means "current NUMA node or the first one
with enough memory available" while it could be "or the closest one".

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

end of thread, other threads:[~2021-07-04 16:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04  1:38 [dpdk-dev] NUMA node/socket Thomas Monjalon
2021-07-04  1:53 ` Thomas Monjalon
2021-07-04  8:27   ` Andrew Rybchenko
2021-07-04  9:28     ` Thomas Monjalon
2021-07-04 16:18       ` Stephen Hemminger
2021-07-04 16:27       ` Dmitry Kozlyuk

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