[PATCH v5] enhance NUMA affinity heuristic

Thomas Monjalon thomas at monjalon.net
Wed Apr 19 14:16:45 CEST 2023


13/04/2023 02:56, You, KaisenX:
> From: You, KaisenX
> > From: Thomas Monjalon <thomas at monjalon.net>
> > >
> > > I'm not comfortable with this patch.
> > >
> > > First, there is no comment in the code which helps to understand the logic.
> > > Second, I'm afraid changing the value of the per-core variable
> > > _socket_id may have an impact on some applications.
> > >
> Hi Thomas, I'm sorry to bother you again, but we can't think of a better solution for now,
> would you please give me some suggestion, and then I will modify it accordingly.

You need to better explain the logic
both in the commit message and in code comments.
When it will be done, it will be easier to have a discussion
with other maintainers and community experts.
Thank you

> > Thank you for your reply.
> > First, about comments, I can submit a new patch to add comments to help
> > understand.
> > Second, if you do not change the value of the per-core variable_ socket_ id,
> > /lib/eal/common/malloc_heap.c
> > malloc_get_numa_socket(void)
> > {
> >         const struct internal_config *conf = eal_get_internal_configuration();
> >         unsigned int socket_id = rte_socket_id();   // The return value of
> > "rte_socket_id()" is 1
> >         unsigned int idx;
> > 
> >         if (socket_id != (unsigned int)SOCKET_ID_ANY)
> >                 return socket_id;    //so return here
> > 
> > This will cause return here, This function returns the socket_id of unallocated
> > memory.
> > 
> > If you have a better solution, I can modify it.






More information about the stable mailing list