From: Sage Weil Date: Fri, 4 Jan 2019 02:51:01 +0000 (-0600) Subject: osd: report numa node for network interface(s) X-Git-Tag: v14.1.0~436^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2328b6cd9cf7d61727fbd8e460eabc45e495191b;p=ceph.git osd: report numa node for network interface(s) Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 56d03f4e1662..ab1a7db4d5a0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -50,6 +50,7 @@ #include "common/version.h" #include "common/pick_address.h" #include "common/blkdev.h" +#include "common/numa.h" #include "os/ObjectStore.h" #ifdef HAVE_LIBFUSE @@ -5785,6 +5786,43 @@ void OSD::_collect_metadata(map *pm) cct, cluster_messenger->get_myaddrs().front().get_sockaddr_storage()); + // network numa + { + int node = -1; + set nodes; + string cpu_list; + set unknown; + for (auto nm : { "front_iface", "back_iface" }) { + if (!(*pm)[nm].size()) { + unknown.insert(nm); + continue; + } + cpu_set_t cpu_set; + size_t cpu_set_size; + int n = -1; + int r = get_iface_numa_node((*pm)[nm], &n, &cpu_set_size, &cpu_set); + if (r < 0) { + unknown.insert((*pm)[nm]); + continue; + } + nodes.insert(n); + if (node < 0) { + node = n; + cpu_list = cpu_set_to_str_list(cpu_set_size, &cpu_set); + } + } + if (unknown.size()) { + (*pm)["network_numa_unknown_ifaces"] = stringify(unknown); + } + if (!nodes.empty()) { + (*pm)["network_numa_nodes"] = stringify(nodes); + } + if (node >= 0 && nodes.size() == 1 && unknown.empty()) { + (*pm)["network_numa_node"] = stringify(node); + (*pm)["network_numa_node_cpus"] = cpu_list; + } + } + set devnames; store->get_devices(&devnames); (*pm)["devices"] = stringify(devnames);