]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: report numa node for network interface(s)
authorSage Weil <sage@redhat.com>
Fri, 4 Jan 2019 02:51:01 +0000 (20:51 -0600)
committerSage Weil <sage@redhat.com>
Tue, 8 Jan 2019 18:57:00 +0000 (12:57 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 56d03f4e16623c3182f586b50b5322c8142cdf5c..ab1a7db4d5a06fb8fff1360aaefa1b2d44c718ba 100644 (file)
@@ -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<string,string> *pm)
     cct,
     cluster_messenger->get_myaddrs().front().get_sockaddr_storage());
 
+  // network numa
+  {
+    int node = -1;
+    set<int> nodes;
+    string cpu_list;
+    set<string> 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<string> devnames;
   store->get_devices(&devnames);
   (*pm)["devices"] = stringify(devnames);