[ovs-dev] [PATCH v8 2/2] netdev-afxdp: NUMA-aware memory allocation for XSK related memory

Yi-Hung Wei yihung.wei at gmail.com
Sat Jan 4 01:12:27 UTC 2020


On Fri, Jan 3, 2020 at 7:09 AM Ilya Maximets <i.maximets at ovn.org> wrote:
>
> On 18.12.2019 21:31, Yi-Hung Wei wrote:
> > --- a/lib/netdev-afxdp.c
> > +++ b/lib/netdev-afxdp.c
> > @@ -692,6 +701,10 @@ netdev_afxdp_reconfigure(struct netdev *netdev)
> >      netdev_change_seq_changed(netdev);
> >  out:
> >      ovs_mutex_unlock(&dev->mutex);
> > +    if (old_bm) {
> > +        numa_set_membind(old_bm);
>
> This will not return previous numa policy, it will set policy
> to membind, which might be not expected by the user.
>
> I don't see a valid wrapper for that, so it seems like the only
> way is to use get/set_mempolicy directly for restoring the original
> memory policy.

Thanks for pointing this out.  Yes, after checking on libnuma there is
not proper wrapper to export and restore the original memory policy .
I would use get/set_mempolicy to achieve that in the next version.

>
> BTW, you're not allowed to use any libnuma functions if !numa_available().
> You need to check it first somewhere.

Sure, I will add a check with numa_available() in the next version.

Thanks,

-Yi-Hung


More information about the dev mailing list