[dpdk-dev] eal: disable NUMA related warnings on non-NUMA systems
Checks
Commit Message
Disabling NUMA warnings on non-NUMA systems.
"EAL: eal_parse_sysfs_value(): cannot open sysfs value
/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
in socket_id 0"
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++++
2 files changed, 8 insertions(+), 4 deletions(-)
Comments
13/07/2017 13:28, Hemant Agrawal:
> Disabling NUMA warnings on non-NUMA systems.
>
> "EAL: eal_parse_sysfs_value(): cannot open sysfs value
> /sys/bus/pci/devices/0000:00:00.0/numa_node
> EAL: numa_node is invalid or not present. Set it 0 as default
> EAL: cannot open /proc/self/numa_maps, consider that all memory is
> in socket_id 0"
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
If I understand well, you are disabling every warnings when DPDK
is compiled without libnuma.
I think we should keep one warning in case libnuma is not available
but it is running on a NUMA system.
What about adding this kind of sysfs check?
#ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
if (sysfs/numa_node is present)
RTE_LOG(WARN, "Only the first NUMA node will be used\n");
#endif
On 7/21/2017 11:31 AM, Thomas Monjalon wrote:
> 13/07/2017 13:28, Hemant Agrawal:
>> Disabling NUMA warnings on non-NUMA systems.
>>
>> "EAL: eal_parse_sysfs_value(): cannot open sysfs value
>> /sys/bus/pci/devices/0000:00:00.0/numa_node
>> EAL: numa_node is invalid or not present. Set it 0 as default
>> EAL: cannot open /proc/self/numa_maps, consider that all memory is
>> in socket_id 0"
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> If I understand well, you are disabling every warnings when DPDK
> is compiled without libnuma.
> I think we should keep one warning in case libnuma is not available
> but it is running on a NUMA system.
>
> What about adding this kind of sysfs check?
>
> #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
> if (sysfs/numa_node is present)
> RTE_LOG(WARN, "Only the first NUMA node will be used\n");
> #endif
>
Good suggestion. I will rework the patch.
@@ -595,6 +595,7 @@ unmap_all_hugepages_orig(struct hugepage_file *hugepg_tbl, struct hugepage_info
return 0;
}
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
/*
* Parse /proc/self/numa_maps to get the NUMA socket ID for each huge
* page.
@@ -662,11 +663,9 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
if (hugepg_tbl[i].orig_va == va) {
hugepg_tbl[i].socket_id = socket_id;
hp_count++;
-#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
RTE_LOG(DEBUG, EAL,
"Hugepage %s is on socket %d\n",
hugepg_tbl[i].filepath, socket_id);
-#endif
}
}
}
@@ -681,6 +680,7 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
fclose(f);
return -1;
}
+#endif
static int
cmp_physaddr(const void *a, const void *b)
@@ -1160,13 +1160,13 @@ rte_eal_hugepage_init(void)
goto fail;
}
}
-
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
if (find_numasocket(&tmp_hp[hp_offset], hpi) < 0){
RTE_LOG(DEBUG, EAL, "Failed to find NUMA socket for %u MB pages\n",
(unsigned)(hpi->hugepage_sz / 0x100000));
goto fail;
}
-
+#endif
qsort(&tmp_hp[hp_offset], hpi->num_pages[0],
sizeof(struct hugepage_file), cmp_physaddr);
@@ -310,6 +310,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
dev->max_vfs = (uint16_t)tmp;
}
+#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
/* get numa node, default to 0 if not present */
snprintf(filename, sizeof(filename), "%s/numa_node",
dirname);
@@ -323,6 +324,9 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
"Set it 0 as default\n");
dev->device.numa_node = 0;
}
+#else
+ dev->device.numa_node = 0;
+#endif
rte_pci_device_name(addr, dev->name, sizeof(dev->name));
dev->device.name = dev->name;