[PATCH 1/3] nodeinfo: Fix gathering of nodeinfo data structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch changes the way data to fill the nodeinfo structure are
gathered. We've gathere the test data by iterating processors an sockets
separately from nodes. The reported data was based solely on information
about core id. Problems arise when eg cores in mulit-processor machines
don't have same id's on both processors or maybe one physical processor
contains more NUMA nodes.

This patch changes the approach how we detect processors and nodes. Now
we start at enumerating nodes and for each node processors, sockets and
threads are enumerated separately. This approach provides acurate data
that comply to docs about the nodeinfo structure. This also enables to
get rid of hacks: see commits 10d9038b744a69c8d4bd29c2e8c012a097481586,
ac9dd4a676f21b5e3ca6dbe0526f2a6709072beb. (Those changes in nodeinfo.c
are efectively reverted by this patch).

This patch also fixes fallout from test caused by missing data in the
test set. Note that output of nodeinfo test 3 changed, as now the
correct node topology is used.
---
 src/nodeinfo.c                                     |  311 ++++++++++++--------
 .../linux-nodeinfo-sysfs-test-2/node/node0/cpu0    |    1 +
 .../linux-nodeinfo-sysfs-test-2/node/node0/cpu1    |    1 +
 .../linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt |    2 +-
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu0    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu12   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu16   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu20   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu4    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/cpu8    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node0/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu24   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu28   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu32   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu36   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu40   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/cpu44   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node1/meminfo |   36 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu11   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu15   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu19   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu23   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu3    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/cpu7    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node2/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu27   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu31   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu35   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu39   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu43   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/cpu47   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node3/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu10   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu14   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu18   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu2    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu22   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/cpu6    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node4/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu26   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu30   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu34   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu38   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu42   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/cpu46   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node5/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu1    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu13   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu17   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu21   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu5    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/cpu9    |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node6/meminfo |   40 ++--
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu25   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu29   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu33   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu37   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu41   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/cpu45   |    1 +
 .../linux-nodeinfo-sysfs-test-3/node/node7/meminfo |   38 ++--
 .../linux-nodeinfo-sysfs-test-3/node/possible      |  Bin 4 -> 5 bytes
 61 files changed, 387 insertions(+), 280 deletions(-)
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu0
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu1
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu0
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu12
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu16
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu20
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu4
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu8
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu24
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu28
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu32
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu36
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu40
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu44
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu11
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu15
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu19
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu23
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu3
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu7
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu27
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu31
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu35
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu39
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu43
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu47
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu10
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu14
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu18
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu2
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu22
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu6
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu26
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu30
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu34
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu38
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu42
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu46
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu1
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu13
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu17
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu21
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu5
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu9
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu25
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu29
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu33
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu37
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu41
 create mode 120000 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu45

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 819f954..ae713da 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -188,38 +188,131 @@ virNodeParseSocket(const char *dir, unsigned int cpu)
     return ret;
 }

+/* parses a node entry, returning number of processors in the node and
+ * filling arguments */
 static int
-virNodeParseNode(const char *sysfs_dir)
+virNodeParseNode(const char *node, int *sockets, int *cores, int *threads)
 {
-    char *file = NULL;
-    char *possible = NULL;
-    char *tmp;
     int ret = -1;
+    int processors = 0;
+    DIR *cpudir = NULL;
+    struct dirent *cpudirent = NULL;
+    int sock_max = 0;
+    cpu_set_t sock_map;
+    int sock;
+    cpu_set_t *core_maps = NULL;
+    int core;
+    int i;
+    int siblings;
+    unsigned int cpu;
+    int online;

-    if (virAsprintf(&file, "%s/node/possible", sysfs_dir) < 0) {
-        virReportOOMError();
+    *threads = 0;
+    *cores = 0;
+    *sockets = 0;
+
+    if (!(cpudir = opendir(node))) {
+        virReportSystemError(errno, _("cannot opendir %s"), node);
         goto cleanup;
     }
-    /* Assume that a missing node/possible file implies no NUMA
-     * support, and hence all cpus belong to the same node.  */
-    if (!virFileExists(file)) {
-        ret = 1;
+
+    /* enumerate sockets in the node */
+    CPU_ZERO(&sock_map);
+    while ((cpudirent = readdir(cpudir))) {
+        if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+            continue;
+
+        /* Parse socket */
+        sock = virNodeParseSocket(node, cpu);
+        CPU_SET(sock, &sock_map);
+
+        if (sock > sock_max)
+            sock_max = sock;
+    }
+
+    if (errno) {
+        virReportSystemError(errno, _("problem reading %s"), node);
         goto cleanup;
     }
-    if (virFileReadAll(file, 1024, &possible) < 0)
+
+    sock_max++;
+
+    /* allocate cpu maps for each socket */
+    if (VIR_ALLOC_N(core_maps, sock_max) < 0) {
+        virReportOOMError();
         goto cleanup;
-    if (virStrToLong_i(possible, &tmp, 10, &ret) < 0 ||
-        (*tmp == '-' && virStrToLong_i(tmp+1, &tmp, 10, &ret) < 0) ||
-        *tmp != '\n') {
-        nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("failed to parse possible nodes '%s'"), possible);
+    }
+
+    for (i = 0; i < sock_max; i++)
+        CPU_ZERO(&core_maps[i]);
+
+    /* iterate over all CPU's in the node */
+    rewinddir(cpudir);
+    while ((cpudirent = readdir(cpudir))) {
+        if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+            continue;
+
+        if ((online = virNodeGetCpuValue(node, cpu, "online", true)) < 0)
+            goto cleanup;
+
+        if (!online)
+            continue;
+
+        processors++;
+
+        /* Parse socket */
+        sock = virNodeParseSocket(node, cpu);
+        if (!CPU_ISSET(sock, &sock_map)) {
+            nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("CPU socket topology has changed"));
+            goto cleanup;
+        }
+
+        /* Parse core */
+# if defined(__s390__) || \
+    defined(__s390x__)
+    /* logical cpu is equivalent to a core on s390 */
+        core = cpu;
+# else
+        core = virNodeGetCpuValue(node, cpu, "topology/core_id", false);
+# endif
+
+        CPU_SET(core, &core_maps[sock]);
+
+        if (!(siblings = virNodeCountThreadSiblings(node, cpu)))
+            goto cleanup;
+
+        if (siblings > *threads)
+            *threads = siblings;
+    }
+
+    if (errno) {
+        virReportSystemError(errno, _("problem reading %s"), node);
         goto cleanup;
     }
-    ret++;
+
+    /* finalize the returned data */
+    *sockets = CPU_COUNT(&sock_map);
+
+    for (i = 0; i < sock_max; i++) {
+        if (!CPU_ISSET(i, &sock_map))
+            continue;
+
+        core = CPU_COUNT(&core_maps[i]);
+        if (core > *cores)
+            *cores = core;
+    }
+
+    ret = processors;

 cleanup:
-    VIR_FREE(file);
-    VIR_FREE(possible);
+    /* don't shadow a more serious error */
+    if (cpudir && closedir(cpudir) < 0 && ret >= 0) {
+        virReportSystemError(errno, _("problem closing %s"), node);
+        ret = -1;
+    }
+    VIR_FREE(core_maps);
+
     return ret;
 }

@@ -228,20 +321,18 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
                              virNodeInfoPtr nodeinfo)
 {
     char line[1024];
-    DIR *cpudir = NULL;
-    struct dirent *cpudirent = NULL;
-    unsigned int cpu;
-    unsigned long core, sock, cur_threads;
-    cpu_set_t core_mask;
-    cpu_set_t socket_mask;
-    int online;
+    DIR *nodedir = NULL;
+    struct dirent *nodedirent = NULL;
+    int cpus, cores, socks, threads;
+    unsigned int node;
     int ret = -1;
+    char *sysfs_nodedir = NULL;
     char *sysfs_cpudir = NULL;
-    unsigned int cpu_cores = 0;

     nodeinfo->cpus = 0;
     nodeinfo->mhz = 0;
     nodeinfo->cores = 0;
+    nodeinfo->nodes = 0;

     /* Start with parsing /proc/cpuinfo; although it tends to have
      * fewer details.  Hyperthreads are ignored at this stage.  */
@@ -254,40 +345,22 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
             char *p;
             unsigned int ui;

-            buf += 9;
+            buf += 7;
             while (*buf && c_isspace(*buf))
                 buf++;

             if (*buf != ':' || !buf[1]) {
-                nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                                "%s", _("parsing cpu MHz from cpuinfo"));
+                nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("parsing cpu MHz from cpuinfo"));
                 goto cleanup;
             }

-            if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0
+            if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0 &&
                 /* Accept trailing fractional part.  */
-                && (*p == '\0' || *p == '.' || c_isspace(*p)))
+                (*p == '\0' || *p == '.' || c_isspace(*p)))
                 nodeinfo->mhz = ui;
         }

-        if (STRPREFIX(buf, "cpu cores")) {
-            char *p;
-            unsigned int ui;
-
-            buf += 9;
-            while (*buf && c_isspace(*buf))
-                buf++;
-
-            if (*buf != ':' || !buf[1]) {
-                nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                                "%s", _("parsing cpu cores from cpuinfo"));
-                return -1;
-            }
-
-            if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0
-                && (*p == '\0' || c_isspace(*p)))
-                cpu_cores = ui;
-         }
 # elif defined(__powerpc__) || \
       defined(__powerpc64__)
         char *buf = line;
@@ -300,14 +373,14 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
                 buf++;

             if (*buf != ':' || !buf[1]) {
-                nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                                "%s", _("parsing cpu MHz from cpuinfo"));
+                nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("parsing cpu MHz from cpuinfo"));
                 goto cleanup;
             }

-            if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0
+            if (virStrToLong_ui(buf+1, &p, 10, &ui) == 0 &&
                 /* Accept trailing fractional part.  */
-                && (*p == '\0' || *p == '.' || c_isspace(*p)))
+                (*p == '\0' || *p == '.' || c_isspace(*p)))
                 nodeinfo->mhz = ui;
             /* No other interesting infos are available in /proc/cpuinfo.
              * However, there is a line identifying processor's version,
@@ -328,115 +401,99 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
     /* OK, we've parsed clock speed out of /proc/cpuinfo. Get the
      * core, node, socket, thread and topology information from /sys
      */
-    if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_dir) < 0) {
+    if (virAsprintf(&sysfs_nodedir, "%s/node", sysfs_dir) < 0) {
         virReportOOMError();
         goto cleanup;
     }
-    cpudir = opendir(sysfs_cpudir);
-    if (cpudir == NULL) {
-        virReportSystemError(errno, _("cannot opendir %s"), sysfs_cpudir);
-        goto cleanup;
+
+    if (!(nodedir = opendir(sysfs_nodedir))) {
+        /* the host isn't probably running a NUMA architecture */
+        goto fallback;
     }

-    CPU_ZERO(&core_mask);
-    CPU_ZERO(&socket_mask);

-    while ((cpudirent = readdir(cpudir))) {
-        if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
+    while ((nodedirent = readdir(nodedir))) {
+        if (sscanf(nodedirent->d_name, "node%u", &node) != 1)
             continue;

-        online = virNodeGetCpuValue(sysfs_cpudir, cpu, "online", true);
-        if (online < 0) {
-            closedir(cpudir);
+        nodeinfo->nodes++;
+
+        if (virAsprintf(&sysfs_cpudir, "%s/node/%s",
+                        sysfs_dir, nodedirent->d_name) < 0) {
+            virReportOOMError();
             goto cleanup;
         }
-        if (!online)
-            continue;
-        nodeinfo->cpus++;

-        /* Parse core */
-# if defined(__s390__) || \
-    defined(__s390x__)
-    /* logical cpu is equivalent to a core on s390 */
-        core = cpu;
-# else
-        core = virNodeGetCpuValue(sysfs_cpudir, cpu, "topology/core_id", false);
-# endif
-        if (!CPU_ISSET(core, &core_mask)) {
-            CPU_SET(core, &core_mask);
-            nodeinfo->cores++;
-        }
+        if ((cpus = virNodeParseNode(sysfs_cpudir, &socks,
+                                     &cores, &threads)) < 0)
+            goto cleanup;

-        /* Parse socket */
-        sock = virNodeParseSocket(sysfs_cpudir, cpu);
-        if (!CPU_ISSET(sock, &socket_mask)) {
-            CPU_SET(sock, &socket_mask);
-            nodeinfo->sockets++;
-        }
+        VIR_FREE(sysfs_cpudir);

-        cur_threads = virNodeCountThreadSiblings(sysfs_cpudir, cpu);
-        if (cur_threads == 0) {
-            closedir(cpudir);
-            goto cleanup;
-        }
-        if (cur_threads > nodeinfo->threads)
-            nodeinfo->threads = cur_threads;
+        nodeinfo->cpus += cpus;
+
+        if (socks > nodeinfo->sockets)
+            nodeinfo->sockets = socks;
+
+        if (cores > nodeinfo->cores)
+            nodeinfo->cores = cores;
+
+        if (threads > nodeinfo->threads)
+            nodeinfo->threads = threads;
     }
+
     if (errno) {
-        virReportSystemError(errno,
-                             _("problem reading %s"), sysfs_cpudir);
-        closedir(cpudir);
+        virReportSystemError(errno, _("problem reading %s"), sysfs_nodedir);
         goto cleanup;
     }
-    if (closedir(cpudir) < 0) {
-        virReportSystemError(errno,
-                             _("problem closing %s"), sysfs_cpudir);
+
+    if (nodeinfo->cpus && nodeinfo->nodes)
+        goto done;
+
+fallback:
+    VIR_FREE(sysfs_cpudir);
+
+    if (virAsprintf(&sysfs_cpudir, "%s/cpu", sysfs_dir) < 0) {
+        virReportOOMError();
         goto cleanup;
     }

-    if ((nodeinfo->nodes = virNodeParseNode(sysfs_dir)) <= 0)
+    if ((cpus = virNodeParseNode(sysfs_cpudir, &socks, &cores, &threads)) < 0)
         goto cleanup;

+    nodeinfo->nodes = 1;
+    nodeinfo->cpus = cpus;
+    nodeinfo->sockets = socks;
+    nodeinfo->cores = cores;
+    nodeinfo->threads = threads;
+
+done:
     /* There should always be at least one cpu, socket, node, and thread. */
     if (nodeinfo->cpus == 0) {
-        nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                        "%s", _("no CPUs found"));
+        nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no CPUs found"));
         goto cleanup;
     }
+
     if (nodeinfo->sockets == 0) {
-        nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                        "%s", _("no sockets found"));
+        nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no sockets found"));
         goto cleanup;
     }
+
     if (nodeinfo->threads == 0) {
-        nodeReportError(VIR_ERR_INTERNAL_ERROR,
-                        "%s", _("no threads found"));
+        nodeReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no threads found"));
         goto cleanup;
     }

-    /* Platform like AMD Magny Cours has two NUMA nodes each package, and
-     * the two nodes share the same core ID set, it results in the cores
-     * number calculated from sysfs is not the actual cores number. Use
-     * "cpu cores" in /proc/cpuinfo as the cores number instead in this case.
-     * More details about the problem:
-     * https://www.redhat.com/archives/libvir-list/2012-May/msg00607.html
-     */
-    if (cpu_cores && (cpu_cores > nodeinfo->cores))
-        nodeinfo->cores = cpu_cores;
-
-    /* nodeinfo->sockets is supposed to be a number of sockets per NUMA node,
-     * however if NUMA nodes are not composed of whole sockets, we just lie
-     * about the number of NUMA nodes and force apps to check capabilities XML
-     * for the actual NUMA topology.
-     */
-    if (nodeinfo->sockets % nodeinfo->nodes == 0)
-        nodeinfo->sockets /= nodeinfo->nodes;
-    else
-        nodeinfo->nodes = 1;
-
     ret = 0;

 cleanup:
+    /* don't shadow a more serious error */
+    if (nodedir && closedir(nodedir) < 0 && ret >= 0) {
+        virReportSystemError(errno, _("problem closing %s"), sysfs_nodedir);
+        ret = -1;
+    }
+
+    VIR_FREE(sysfs_nodedir);
     VIR_FREE(sysfs_cpudir);
     return ret;
 }
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu0 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu0
new file mode 120000
index 0000000..c841bea
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu0
@@ -0,0 +1 @@
+../../cpu/cpu0
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu1 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu1
new file mode 120000
index 0000000..5f45362
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/cpu1
@@ -0,0 +1 @@
+../../cpu/cpu1
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
index 333187e..0306f86 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
@@ -1 +1 @@
-CPUs: 48/48, MHz: 2100, Nodes: 1, Sockets: 4, Cores: 12, Threads: 1
+CPUs: 48/48, MHz: 2100, Nodes: 8, Sockets: 1, Cores: 6, Threads: 1
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu0 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu0
new file mode 120000
index 0000000..c841bea
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu0
@@ -0,0 +1 @@
+../../cpu/cpu0
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu12 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu12
new file mode 120000
index 0000000..211519e
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu12
@@ -0,0 +1 @@
+../../cpu/cpu12
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu16 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu16
new file mode 120000
index 0000000..445de40
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu16
@@ -0,0 +1 @@
+../../cpu/cpu16
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu20 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu20
new file mode 120000
index 0000000..a37c370
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu20
@@ -0,0 +1 @@
+../../cpu/cpu20
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu4 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu4
new file mode 120000
index 0000000..9e77a64
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu4
@@ -0,0 +1 @@
+../../cpu/cpu4
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu8 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu8
new file mode 120000
index 0000000..bda10cc
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/cpu8
@@ -0,0 +1 @@
+../../cpu/cpu8
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo
index ec2bf50..fa5c13d 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo
@@ -1,29 +1,29 @@

 Node 0 MemTotal:       67098848 kB
-Node 0 MemFree:        64989968 kB
-Node 0 MemUsed:         2108880 kB
-Node 0 Active:           136532 kB
-Node 0 Inactive:         146228 kB
-Node 0 Active(anon):      28124 kB
-Node 0 Inactive(anon):      160 kB
-Node 0 Active(file):     108408 kB
-Node 0 Inactive(file):   146068 kB
-Node 0 Unevictable:           0 kB
-Node 0 Mlocked:               0 kB
+Node 0 MemFree:        63476428 kB
+Node 0 MemUsed:         3622420 kB
+Node 0 Active:          1796452 kB
+Node 0 Inactive:          22884 kB
+Node 0 Active(anon):    1790124 kB
+Node 0 Inactive(anon):     1048 kB
+Node 0 Active(file):       6328 kB
+Node 0 Inactive(file):    21836 kB
+Node 0 Unevictable:         196 kB
+Node 0 Mlocked:             196 kB
 Node 0 Dirty:                 0 kB
 Node 0 Writeback:             0 kB
-Node 0 FilePages:        254676 kB
-Node 0 Mapped:             7284 kB
-Node 0 AnonPages:         15816 kB
-Node 0 Shmem:               200 kB
-Node 0 KernelStack:        5904 kB
-Node 0 PageTables:         2328 kB
+Node 0 FilePages:         28444 kB
+Node 0 Mapped:             1728 kB
+Node 0 AnonPages:         19568 kB
+Node 0 Shmem:                84 kB
+Node 0 KernelStack:        5736 kB
+Node 0 PageTables:         5000 kB
 Node 0 NFS_Unstable:          0 kB
 Node 0 Bounce:                0 kB
 Node 0 WritebackTmp:          0 kB
-Node 0 Slab:              53304 kB
-Node 0 SReclaimable:      16580 kB
-Node 0 SUnreclaim:        36724 kB
+Node 0 Slab:              26352 kB
+Node 0 SReclaimable:       4404 kB
+Node 0 SUnreclaim:        21948 kB
 Node 0 HugePages_Total:     0
 Node 0 HugePages_Free:      0
 Node 0 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu24 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu24
new file mode 120000
index 0000000..ad0a618
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu24
@@ -0,0 +1 @@
+../../cpu/cpu24
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu28 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu28
new file mode 120000
index 0000000..83269be
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu28
@@ -0,0 +1 @@
+../../cpu/cpu28
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu32 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu32
new file mode 120000
index 0000000..bbca866
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu32
@@ -0,0 +1 @@
+../../cpu/cpu32
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu36 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu36
new file mode 120000
index 0000000..5e53f70
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu36
@@ -0,0 +1 @@
+../../cpu/cpu36
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu40 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu40
new file mode 120000
index 0000000..c727d46
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu40
@@ -0,0 +1 @@
+../../cpu/cpu40
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu44 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu44
new file mode 120000
index 0000000..859e4fc
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/cpu44
@@ -0,0 +1 @@
+../../cpu/cpu44
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo
index f84bd4c..461c25a 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo
@@ -1,29 +1,29 @@

 Node 1 MemTotal:       67108864 kB
-Node 1 MemFree:        65361692 kB
-Node 1 MemUsed:         1747172 kB
-Node 1 Active:            41004 kB
-Node 1 Inactive:         108288 kB
-Node 1 Active(anon):      14656 kB
-Node 1 Inactive(anon):      292 kB
-Node 1 Active(file):      26348 kB
-Node 1 Inactive(file):   107996 kB
+Node 1 MemFree:        58533044 kB
+Node 1 MemUsed:         8575820 kB
+Node 1 Active:          6950832 kB
+Node 1 Inactive:          49624 kB
+Node 1 Active(anon):    6922916 kB
+Node 1 Inactive(anon):       24 kB
+Node 1 Active(file):      27916 kB
+Node 1 Inactive(file):    49600 kB
 Node 1 Unevictable:           0 kB
 Node 1 Mlocked:               0 kB
-Node 1 Dirty:                 0 kB
+Node 1 Dirty:                 8 kB
 Node 1 Writeback:             0 kB
-Node 1 FilePages:        134664 kB
-Node 1 Mapped:             7012 kB
-Node 1 AnonPages:         14624 kB
-Node 1 Shmem:               324 kB
-Node 1 KernelStack:         176 kB
-Node 1 PageTables:         2488 kB
+Node 1 FilePages:         77584 kB
+Node 1 Mapped:             4024 kB
+Node 1 AnonPages:         12920 kB
+Node 1 Shmem:                68 kB
+Node 1 KernelStack:         192 kB
+Node 1 PageTables:        14256 kB
 Node 1 NFS_Unstable:          0 kB
 Node 1 Bounce:                0 kB
 Node 1 WritebackTmp:          0 kB
-Node 1 Slab:              47096 kB
-Node 1 SReclaimable:      13716 kB
-Node 1 SUnreclaim:        33380 kB
+Node 1 Slab:              11928 kB
+Node 1 SReclaimable:       5240 kB
+Node 1 SUnreclaim:         6688 kB
 Node 1 HugePages_Total:     0
 Node 1 HugePages_Free:      0
 Node 1 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu11 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu11
new file mode 120000
index 0000000..e29d898
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu11
@@ -0,0 +1 @@
+../../cpu/cpu11
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu15 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu15
new file mode 120000
index 0000000..e905d85
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu15
@@ -0,0 +1 @@
+../../cpu/cpu15
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu19 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu19
new file mode 120000
index 0000000..c671083
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu19
@@ -0,0 +1 @@
+../../cpu/cpu19
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu23 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu23
new file mode 120000
index 0000000..75c2f57
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu23
@@ -0,0 +1 @@
+../../cpu/cpu23
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu3 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu3
new file mode 120000
index 0000000..c7690e5
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu3
@@ -0,0 +1 @@
+../../cpu/cpu3
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu7 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu7
new file mode 120000
index 0000000..09e3f79
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/cpu7
@@ -0,0 +1 @@
+../../cpu/cpu7
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo
index c755e48..1db62d0 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo
@@ -1,29 +1,29 @@

 Node 2 MemTotal:       67108864 kB
-Node 2 MemFree:        64350240 kB
-Node 2 MemUsed:         2758624 kB
-Node 2 Active:          1049208 kB
-Node 2 Inactive:         121980 kB
-Node 2 Active(anon):     944424 kB
-Node 2 Inactive(anon):      668 kB
-Node 2 Active(file):     104784 kB
-Node 2 Inactive(file):   121312 kB
-Node 2 Unevictable:           0 kB
-Node 2 Mlocked:               0 kB
+Node 2 MemFree:        63106144 kB
+Node 2 MemUsed:         4002720 kB
+Node 2 Active:          2433572 kB
+Node 2 Inactive:           8140 kB
+Node 2 Active(anon):    2429364 kB
+Node 2 Inactive(anon):       24 kB
+Node 2 Active(file):       4208 kB
+Node 2 Inactive(file):     8116 kB
+Node 2 Unevictable:           4 kB
+Node 2 Mlocked:               4 kB
 Node 2 Dirty:                 0 kB
 Node 2 Writeback:             0 kB
-Node 2 FilePages:        226784 kB
-Node 2 Mapped:            10920 kB
-Node 2 AnonPages:         35148 kB
-Node 2 Shmem:               684 kB
-Node 2 KernelStack:        1400 kB
-Node 2 PageTables:         6228 kB
+Node 2 FilePages:         12424 kB
+Node 2 Mapped:             3100 kB
+Node 2 AnonPages:          4476 kB
+Node 2 Shmem:                84 kB
+Node 2 KernelStack:         112 kB
+Node 2 PageTables:         4980 kB
 Node 2 NFS_Unstable:          0 kB
 Node 2 Bounce:                0 kB
 Node 2 WritebackTmp:          0 kB
-Node 2 Slab:              24700 kB
-Node 2 SReclaimable:      15072 kB
-Node 2 SUnreclaim:         9628 kB
+Node 2 Slab:               8292 kB
+Node 2 SReclaimable:       2260 kB
+Node 2 SUnreclaim:         6032 kB
 Node 2 HugePages_Total:     0
 Node 2 HugePages_Free:      0
 Node 2 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu27 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu27
new file mode 120000
index 0000000..74ced19
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu27
@@ -0,0 +1 @@
+../../cpu/cpu27
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu31 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu31
new file mode 120000
index 0000000..6a9a569
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu31
@@ -0,0 +1 @@
+../../cpu/cpu31
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu35 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu35
new file mode 120000
index 0000000..47654d6
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu35
@@ -0,0 +1 @@
+../../cpu/cpu35
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu39 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu39
new file mode 120000
index 0000000..d465480
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu39
@@ -0,0 +1 @@
+../../cpu/cpu39
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu43 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu43
new file mode 120000
index 0000000..03b2d2d
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu43
@@ -0,0 +1 @@
+../../cpu/cpu43
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu47 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu47
new file mode 120000
index 0000000..19407d4
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/cpu47
@@ -0,0 +1 @@
+../../cpu/cpu47
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo
index b580944..aa114db 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo
@@ -1,29 +1,29 @@

 Node 3 MemTotal:       67108864 kB
-Node 3 MemFree:        65372380 kB
-Node 3 MemUsed:         1736484 kB
-Node 3 Active:            87008 kB
-Node 3 Inactive:          71908 kB
-Node 3 Active(anon):      25684 kB
-Node 3 Inactive(anon):      444 kB
-Node 3 Active(file):      61324 kB
-Node 3 Inactive(file):    71464 kB
-Node 3 Unevictable:           0 kB
-Node 3 Mlocked:               0 kB
+Node 3 MemFree:        57821716 kB
+Node 3 MemUsed:         9287148 kB
+Node 3 Active:          7526420 kB
+Node 3 Inactive:         156352 kB
+Node 3 Active(anon):    7510420 kB
+Node 3 Inactive(anon):       52 kB
+Node 3 Active(file):      16000 kB
+Node 3 Inactive(file):   156300 kB
+Node 3 Unevictable:        2244 kB
+Node 3 Mlocked:            2244 kB
 Node 3 Dirty:                 0 kB
 Node 3 Writeback:             0 kB
-Node 3 FilePages:        133260 kB
-Node 3 Mapped:            13668 kB
-Node 3 AnonPages:         21560 kB
-Node 3 Shmem:               472 kB
-Node 3 KernelStack:         680 kB
-Node 3 PageTables:         2392 kB
+Node 3 FilePages:        174648 kB
+Node 3 Mapped:             3260 kB
+Node 3 AnonPages:          2400 kB
+Node 3 Shmem:               104 kB
+Node 3 KernelStack:         104 kB
+Node 3 PageTables:        14812 kB
 Node 3 NFS_Unstable:          0 kB
 Node 3 Bounce:                0 kB
 Node 3 WritebackTmp:          0 kB
-Node 3 Slab:              26296 kB
-Node 3 SReclaimable:      18312 kB
-Node 3 SUnreclaim:         7984 kB
+Node 3 Slab:              39052 kB
+Node 3 SReclaimable:       7772 kB
+Node 3 SUnreclaim:        31280 kB
 Node 3 HugePages_Total:     0
 Node 3 HugePages_Free:      0
 Node 3 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu10 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu10
new file mode 120000
index 0000000..a6dc6bb
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu10
@@ -0,0 +1 @@
+../../cpu/cpu10
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu14 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu14
new file mode 120000
index 0000000..24cb3b4
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu14
@@ -0,0 +1 @@
+../../cpu/cpu14
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu18 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu18
new file mode 120000
index 0000000..3809adc
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu18
@@ -0,0 +1 @@
+../../cpu/cpu18
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu2 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu2
new file mode 120000
index 0000000..2dcca33
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu2
@@ -0,0 +1 @@
+../../cpu/cpu2
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu22 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu22
new file mode 120000
index 0000000..2c226ae
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu22
@@ -0,0 +1 @@
+../../cpu/cpu22
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu6 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu6
new file mode 120000
index 0000000..2e75763
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/cpu6
@@ -0,0 +1 @@
+../../cpu/cpu6
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo
index 8ad9b86..99da2c2 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo
@@ -1,29 +1,29 @@

 Node 4 MemTotal:       67108864 kB
-Node 4 MemFree:        64730416 kB
-Node 4 MemUsed:         2378448 kB
-Node 4 Active:           522732 kB
-Node 4 Inactive:         205384 kB
-Node 4 Active(anon):     411816 kB
-Node 4 Inactive(anon):      384 kB
-Node 4 Active(file):     110916 kB
-Node 4 Inactive(file):   205000 kB
-Node 4 Unevictable:           0 kB
-Node 4 Mlocked:               0 kB
+Node 4 MemFree:        60434724 kB
+Node 4 MemUsed:         6674140 kB
+Node 4 Active:          4945652 kB
+Node 4 Inactive:          93972 kB
+Node 4 Active(anon):    4942460 kB
+Node 4 Inactive(anon):    90756 kB
+Node 4 Active(file):       3192 kB
+Node 4 Inactive(file):     3216 kB
+Node 4 Unevictable:         488 kB
+Node 4 Mlocked:             488 kB
 Node 4 Dirty:                 0 kB
 Node 4 Writeback:             0 kB
-Node 4 FilePages:        316320 kB
-Node 4 Mapped:            10220 kB
-Node 4 AnonPages:        129184 kB
-Node 4 Shmem:               408 kB
-Node 4 KernelStack:         336 kB
-Node 4 PageTables:         2732 kB
+Node 4 FilePages:         97660 kB
+Node 4 Mapped:             1216 kB
+Node 4 AnonPages:          7008 kB
+Node 4 Shmem:             90964 kB
+Node 4 KernelStack:          80 kB
+Node 4 PageTables:        10284 kB
 Node 4 NFS_Unstable:          0 kB
 Node 4 Bounce:                0 kB
 Node 4 WritebackTmp:          0 kB
-Node 4 Slab:              54172 kB
-Node 4 SReclaimable:      41160 kB
-Node 4 SUnreclaim:        13012 kB
+Node 4 Slab:              71800 kB
+Node 4 SReclaimable:      35888 kB
+Node 4 SUnreclaim:        35912 kB
 Node 4 HugePages_Total:     0
 Node 4 HugePages_Free:      0
 Node 4 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu26 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu26
new file mode 120000
index 0000000..1dd180f
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu26
@@ -0,0 +1 @@
+../../cpu/cpu26
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu30 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu30
new file mode 120000
index 0000000..80226fa
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu30
@@ -0,0 +1 @@
+../../cpu/cpu30
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu34 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu34
new file mode 120000
index 0000000..0c0e738
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu34
@@ -0,0 +1 @@
+../../cpu/cpu34
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu38 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu38
new file mode 120000
index 0000000..7231eb4
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu38
@@ -0,0 +1 @@
+../../cpu/cpu38
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu42 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu42
new file mode 120000
index 0000000..8ebd18e
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu42
@@ -0,0 +1 @@
+../../cpu/cpu42
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu46 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu46
new file mode 120000
index 0000000..55223e0
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/cpu46
@@ -0,0 +1 @@
+../../cpu/cpu46
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo
index fb93073..eabd9b1 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo
@@ -1,29 +1,29 @@

 Node 5 MemTotal:       67108864 kB
-Node 5 MemFree:        65315792 kB
-Node 5 MemUsed:         1793072 kB
-Node 5 Active:            92864 kB
-Node 5 Inactive:         118500 kB
-Node 5 Active(anon):      17360 kB
-Node 5 Inactive(anon):      280 kB
-Node 5 Active(file):      75504 kB
-Node 5 Inactive(file):   118220 kB
-Node 5 Unevictable:           0 kB
-Node 5 Mlocked:               0 kB
+Node 5 MemFree:        63584868 kB
+Node 5 MemUsed:         3523996 kB
+Node 5 Active:          1955824 kB
+Node 5 Inactive:           3628 kB
+Node 5 Active(anon):    1949640 kB
+Node 5 Inactive(anon):        8 kB
+Node 5 Active(file):       6184 kB
+Node 5 Inactive(file):     3620 kB
+Node 5 Unevictable:         244 kB
+Node 5 Mlocked:             244 kB
 Node 5 Dirty:                 0 kB
 Node 5 Writeback:             0 kB
-Node 5 FilePages:        194028 kB
-Node 5 Mapped:             7680 kB
-Node 5 AnonPages:         13240 kB
-Node 5 Shmem:               304 kB
-Node 5 KernelStack:         160 kB
-Node 5 PageTables:         1756 kB
+Node 5 FilePages:         10112 kB
+Node 5 Mapped:             1612 kB
+Node 5 AnonPages:          1936 kB
+Node 5 Shmem:                64 kB
+Node 5 KernelStack:          80 kB
+Node 5 PageTables:         4136 kB
 Node 5 NFS_Unstable:          0 kB
 Node 5 Bounce:                0 kB
 Node 5 WritebackTmp:          0 kB
-Node 5 Slab:              30128 kB
-Node 5 SReclaimable:      21380 kB
-Node 5 SUnreclaim:         8748 kB
+Node 5 Slab:               9420 kB
+Node 5 SReclaimable:       1772 kB
+Node 5 SUnreclaim:         7648 kB
 Node 5 HugePages_Total:     0
 Node 5 HugePages_Free:      0
 Node 5 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu1 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu1
new file mode 120000
index 0000000..5f45362
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu1
@@ -0,0 +1 @@
+../../cpu/cpu1
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu13 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu13
new file mode 120000
index 0000000..52d3b69
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu13
@@ -0,0 +1 @@
+../../cpu/cpu13
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu17 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu17
new file mode 120000
index 0000000..13929db
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu17
@@ -0,0 +1 @@
+../../cpu/cpu17
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu21 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu21
new file mode 120000
index 0000000..68a7cad
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu21
@@ -0,0 +1 @@
+../../cpu/cpu21
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu5 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu5
new file mode 120000
index 0000000..cc07c3b
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu5
@@ -0,0 +1 @@
+../../cpu/cpu5
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu9 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu9
new file mode 120000
index 0000000..1ec1db2
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/cpu9
@@ -0,0 +1 @@
+../../cpu/cpu9
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo
index d4fa1d0..c83c1bf 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo
@@ -1,29 +1,29 @@

 Node 6 MemTotal:       67108864 kB
-Node 6 MemFree:        65259848 kB
-Node 6 MemUsed:         1849016 kB
-Node 6 Active:           105044 kB
-Node 6 Inactive:         164968 kB
-Node 6 Active(anon):      13332 kB
-Node 6 Inactive(anon):      368 kB
-Node 6 Active(file):      91712 kB
-Node 6 Inactive(file):   164600 kB
-Node 6 Unevictable:           0 kB
-Node 6 Mlocked:               0 kB
-Node 6 Dirty:                 0 kB
+Node 6 MemFree:        59956600 kB
+Node 6 MemUsed:         7152264 kB
+Node 6 Active:          5526616 kB
+Node 6 Inactive:          50148 kB
+Node 6 Active(anon):    5519092 kB
+Node 6 Inactive(anon):    18256 kB
+Node 6 Active(file):       7524 kB
+Node 6 Inactive(file):    31892 kB
+Node 6 Unevictable:        1248 kB
+Node 6 Mlocked:            1248 kB
+Node 6 Dirty:                 4 kB
 Node 6 Writeback:             0 kB
-Node 6 FilePages:        256704 kB
-Node 6 Mapped:             3704 kB
-Node 6 AnonPages:         13324 kB
-Node 6 Shmem:               392 kB
-Node 6 KernelStack:         216 kB
-Node 6 PageTables:         1964 kB
+Node 6 FilePages:         60336 kB
+Node 6 Mapped:             1452 kB
+Node 6 AnonPages:         29028 kB
+Node 6 Shmem:             20624 kB
+Node 6 KernelStack:        1928 kB
+Node 6 PageTables:        11172 kB
 Node 6 NFS_Unstable:          0 kB
 Node 6 Bounce:                0 kB
 Node 6 WritebackTmp:          0 kB
-Node 6 Slab:              28548 kB
-Node 6 SReclaimable:      19596 kB
-Node 6 SUnreclaim:         8952 kB
+Node 6 Slab:              12844 kB
+Node 6 SReclaimable:       3692 kB
+Node 6 SUnreclaim:         9152 kB
 Node 6 HugePages_Total:     0
 Node 6 HugePages_Free:      0
 Node 6 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu25 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu25
new file mode 120000
index 0000000..3145742
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu25
@@ -0,0 +1 @@
+../../cpu/cpu25
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu29 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu29
new file mode 120000
index 0000000..fa37dc6
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu29
@@ -0,0 +1 @@
+../../cpu/cpu29
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu33 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu33
new file mode 120000
index 0000000..b7a9f8d
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu33
@@ -0,0 +1 @@
+../../cpu/cpu33
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu37 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu37
new file mode 120000
index 0000000..41b4ce7
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu37
@@ -0,0 +1 @@
+../../cpu/cpu37
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu41 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu41
new file mode 120000
index 0000000..cc0b78c
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu41
@@ -0,0 +1 @@
+../../cpu/cpu41
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu45 b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu45
new file mode 120000
index 0000000..58c3ca3
--- /dev/null
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/cpu45
@@ -0,0 +1 @@
+../../cpu/cpu45
\ No newline at end of file
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo
index 4f43eae..94566d6 100644
--- a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo
+++ b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo
@@ -1,29 +1,29 @@

 Node 7 MemTotal:       67108864 kB
-Node 7 MemFree:        65303740 kB
-Node 7 MemUsed:         1805124 kB
-Node 7 Active:            60264 kB
-Node 7 Inactive:          77164 kB
-Node 7 Active(anon):      27672 kB
-Node 7 Inactive(anon):      632 kB
-Node 7 Active(file):      32592 kB
-Node 7 Inactive(file):    76532 kB
-Node 7 Unevictable:           0 kB
-Node 7 Mlocked:               0 kB
+Node 7 MemFree:        63509808 kB
+Node 7 MemUsed:         3599056 kB
+Node 7 Active:          1813772 kB
+Node 7 Inactive:         152964 kB
+Node 7 Active(anon):    1806008 kB
+Node 7 Inactive(anon):     4400 kB
+Node 7 Active(file):       7764 kB
+Node 7 Inactive(file):   148564 kB
+Node 7 Unevictable:          12 kB
+Node 7 Mlocked:              12 kB
 Node 7 Dirty:                 0 kB
 Node 7 Writeback:             0 kB
-Node 7 FilePages:        109772 kB
-Node 7 Mapped:             5508 kB
-Node 7 AnonPages:         27668 kB
-Node 7 Shmem:               648 kB
-Node 7 KernelStack:         208 kB
-Node 7 PageTables:         1820 kB
+Node 7 FilePages:        160820 kB
+Node 7 Mapped:             4208 kB
+Node 7 AnonPages:         34432 kB
+Node 7 Shmem:              4484 kB
+Node 7 KernelStack:         152 kB
+Node 7 PageTables:         3728 kB
 Node 7 NFS_Unstable:          0 kB
 Node 7 Bounce:                0 kB
 Node 7 WritebackTmp:          0 kB
-Node 7 Slab:              19372 kB
-Node 7 SReclaimable:      11024 kB
-Node 7 SUnreclaim:         8348 kB
+Node 7 Slab:              12760 kB
+Node 7 SReclaimable:       3636 kB
+Node 7 SUnreclaim:         9124 kB
 Node 7 HugePages_Total:     0
 Node 7 HugePages_Free:      0
 Node 7 HugePages_Surp:      0
diff --git a/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/possible b/tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/possible
index 74fc2fb6b048c39d90b0c17de3824095162634f8..21408fdea85537c7277785de368c5cef105e30ed 100644
GIT binary patch
literal 5
McmXreHRoag00LqFp8x;=

literal 4
LcmXreHRl2V0mA^F

-- 
1.7.8.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]