aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/linux
diff options
context:
space:
mode:
authorDamjan Marion <damjan.marion@gmail.com>2018-01-03 15:48:34 +0000
committerDave Wallace <dwallacelf@gmail.com>2018-01-09 20:34:30 +0000
commit2e172eab36d8b3d53e5c88e29ca81d7d7ecd9620 (patch)
tree98d690e2bf5a7914bae7f52f031d083b09f4c3b2 /src/vppinfra/linux
parenta5fb2cf8be8298e589c2b619f7e907a0a1d76262 (diff)
physmem: fix physmem allocation on kernels without NUMA support
Change-Id: I056598a1818a39c2da73e252600c14585e5aae83 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/linux')
-rw-r--r--src/vppinfra/linux/mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index 2d8f593d2b6..e0e22b0a775 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -71,12 +71,12 @@ clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t * a)
if (a->flags & (CLIB_MEM_VM_F_NUMA_PREFER | CLIB_MEM_VM_F_NUMA_FORCE))
{
int rv;
- rv =
- get_mempolicy (&old_mpol, old_mask, sizeof (old_mask) * 8 + 1, 0, 0);
+ rv = get_mempolicy (&old_mpol, old_mask, sizeof (old_mask) * 8 + 1,
+ 0, 0);
if (rv == -1)
{
- if ((a->flags & CLIB_MEM_VM_F_NUMA_FORCE) != 0)
+ if (a->numa_node != 0 && (a->flags & CLIB_MEM_VM_F_NUMA_FORCE) != 0)
{
err = clib_error_return_unix (0, "get_mempolicy");
goto error;
@@ -193,7 +193,7 @@ clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t * a)
goto error;
}
- /* re-apply ole numa memory policy */
+ /* re-apply old numa memory policy */
if (old_mpol != -1 &&
set_mempolicy (old_mpol, old_mask, sizeof (old_mask) * 8 + 1) == -1)
{