[dpdk-dev] [PATCH v5 0/2] Balanced allocation of hugepages

Jerin Jacob jerin.jacob at caviumnetworks.com
Wed Jun 21 11:27:45 CEST 2017


-----Original Message-----
> Date: Wed, 21 Jun 2017 10:49:14 +0200
> From: Thomas Monjalon <thomas at monjalon.net>
> To: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> Cc: Sergio Gonzalez Monroy <sergio.gonzalez.monroy at intel.com>, Hemant
>  Agrawal <hemant.agrawal at nxp.com>, Ilya Maximets <i.maximets at samsung.com>,
>  dev at dpdk.org, Bruce Richardson <bruce.richardson at intel.com>, David
>  Marchand <david.marchand at 6wind.com>, Heetae Ahn
>  <heetae82.ahn at samsung.com>, Yuanhan Liu <yliu at fridaylinux.org>, Jianfeng
>  Tan <jianfeng.tan at intel.com>, Neil Horman <nhorman at tuxdriver.com>, Yulong
>  Pei <yulong.pei at intel.com>
> Subject: Re: [PATCH v5 0/2] Balanced allocation of hugepages
> 
> 21/06/2017 10:41, Jerin Jacob:
> > > > 1. There are many machines (arm/ppc), which do not support NUMA.
> > > > 
> > > > https://wiki.linaro.org/LEG/Engineering/Kernel/NUMA
> > > > 
> > > 
> > > I did find that link too, last modified 4 years ago.
> > > Despite that, I could not find any ARM references in libnuma sources, but
> > > Jerin proved that there is support for it.
> > > 
> > > http://oss.sgi.com/projects/libnuma/
> > > https://github.com/numactl/numactl
> > 
> > Those Linaro links are very old. ARM64 NUMA supported has been added in 4.7 kernel.
> > I guess we are talking about build time time dependency with libnuma here.
> > Correct? I think, Even with old arm64 kernel(< 4.6), You can build against
> > libnuma if it is present in rootfs. Just that at runtime, it will return
> > NUMA support not available. Correct?
> > 
> > How hard is detect the presence of "numaif.h" if existing build system does not
> > support it? If it trivial, we can enable RTE_LIBRTE_EAL_NUMA_AWARE_HUGEPAGES
> > if build environment has "numaif.h".
> > 
> > Some example in linux kernel build system:
> > http://lxr.linux.no/linux+v4.10.1/scripts/gcc-goto.sh
> 
> I think we should not try to detect numaif.h, because it should be
> an error on platform supporting NUMA.

I have installed libnuma on a NUMA and non NUMA machine.
Compiled and ran following code on those machine and it could detect
the numa availability. Could you add more details on the "error on
platform supporting NUMA".

➜ 83xx [ctest] $ cat main.c
#include <numaif.h>
#include <stdio.h>
#include <errno.h>

int main()
{
        /* Check if kernel supports NUMA. */
        if (get_mempolicy(NULL, NULL, 0, 0, 0) < 0 && errno == ENOSYS) {
                printf("NUMA is not supported.\n");
        } else {
                printf("NUMA is supported.\n");
        }

}
➜ 83xx [ctest] $ gcc -Wall main.c -lnuma
# On non numa system
➜ 83xx [ctest] $ ./a.out
NUMA is not supported

# On numa machine
➜ GB-2S [~] $ ./a.out
NUMA is supported.


> If someone really wants to build DPDK without NUMA for x86, he should
> disable it in the build config file.


More information about the dev mailing list