[RFC PATCH 1/2] nodeinfo: Reflect guest usable host topology on PPC64

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

 



Today, the topology displayed by nodeinfo/capabilities is reflecting the host
topology irrespective the subcore_per_core setting.
This is not of much use as user cannot determine what is the maximum
possible threads_per_core value he can use for a guest topology.

For subcore_per_core = 1, the guest topology can have threads_per_core=1,2,4
or 8. Same way for subcore_per_core = 2, the guest toplogy can have
threads_per_core=1,2 or 4; and for subcore_per_core = 4, guest threads_per_core
can be 1 or 2 only.

Incidentally, the topology displayed in subcore_per_core=1 is correct and is
usable today. If we can display the guest usable topology info for
subcore_per_core=2 and 4 too, then it can help making guest topology decisions.

Signed-off-by: Shivaprasad G Bhat <sbhat@xxxxxxxxxxxxxxxxxx>
---
 src/nodeinfo.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 77ea155..531e0ee 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -849,6 +849,23 @@ linuxNodeInfoCPUPopulate(const char *sysfs_prefix,
         goto cleanup;
     }
 
+    /* On PPC if host is in a valid sub core mode, the maximum supported
+     * threads_per_core for a guest is decided by the maximum
+     * threads_per_subcore.
+     * In other words on P8, if the subcores-per-core=1,
+     * the guest can have cpu topology with threads_per_core=1, 2, 4 or 8
+     * and for subcores-per-core=2, the guest can have
+     * threads_per_core=1, 2 or 4 only. Same way, for subcores-per-core=4
+     * guest can have threads_per_core=1 or 2 only.
+     * On a valid kvm host reflecddt the guest supportable topology instead
+     * of host topology.
+     */
+    if (threads_per_subcore) {
+        int subcores_per_core = nodeinfo->threads/threads_per_subcore;
+        nodeinfo->cores *= subcores_per_core;
+        nodeinfo->threads /= subcores_per_core;
+    }
+
     /* Now check if the topology makes sense. There are machines that don't
      * expose their real number of nodes or for example the AMD Bulldozer
      * architecture that exposes their Clustered integer core modules as both

--
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]