Skip to contentSkip to conversation

exanime: test for SMT and add a host flag

PATCH In review Roger Pau Monne 2 participants 4 messages Apr 15, 2020 – Apr 21, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 exanime: test for SMT and add a host flag

Check if hosts have SMT based on the number of threads per core. A value of threads per core greater than 1 implies SMT support.

---
Changes since v2:
- Use hw-smt.

Changes since v1:
- Fix regex and set SMT if number of threads per core is > 1.

---
 sg-run-job     |  1 +
 ts-examine-cpu | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100755 ts-examine-cpu
sg-run-job +1 -0
index 97011843..aa7953ac 100755
@@ -679,6 +679,7 @@ proc examine-host-examine {install} {
     if {$ok} {
 	run-ts -.  =           ts-examine-serial-post + host
 	run-ts .   =           ts-examine-iommu       + host
+	run-ts .   =           ts-examine-cpu         + host
 	run-ts .   =           ts-examine-logs-save   + host
 	run-ts .   =           ts-examine-hostprops-save
     }
ts-examine-cpu new file +32 -0
new file mode 100755
index 00000000..81cf7544
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2020 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+BEGIN { unshift @INC, qw(.); }
+use Osstest;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+our $info = target_cmd_output_root($ho, 'xl info', 10);
+our $threads = $info =~ /^threads_per_core\s*:\s.*/m;
+
+logm("$ho->{Ident} threads per core: $threads");
+hostflag_putative_record($ho, "hw-smt", $threads > 1);
Signature · 1 line
2.26.0
#1 lore raw

PATCH v3 2/2 make-flight: add a core scheduling job

Run a simple core scheduling tests on a host that has SMT support. This is only enabled for Xen >= 4.13.

The runvar difference is:

+test-amd64-coresched-amd64-xl all_host_di_version 2020-02-10 +test-amd64-coresched-i386-xl all_host_di_version 2020-02-10

+test-amd64-coresched-amd64-xl all_host_suite      stretch
+test-amd64-coresched-i386-xl  all_host_suite      stretch
+test-amd64-coresched-amd64-xl all_hostflags       arch-amd64,arch-xen-amd64,suite-stretch,purpose-test,smt
+test-amd64-coresched-i386-xl  all_hostflags       arch-i386,arch-xen-amd64,suite-stretch,purpose-test,smt
+test-amd64-coresched-amd64-xl arch                amd64
+test-amd64-coresched-i386-xl  arch                i386
+test-amd64-coresched-amd64-xl buildjob            build-amd64
+test-amd64-coresched-i386-xl  buildjob            build-i386
+test-amd64-coresched-amd64-xl debian_arch         amd64
+test-amd64-coresched-i386-xl  debian_arch         i386
+test-amd64-coresched-amd64-xl debian_kernkind     pvops
+test-amd64-coresched-i386-xl  debian_kernkind     pvops
+test-amd64-coresched-amd64-xl debian_suite        stretch
+test-amd64-coresched-i386-xl  debian_suite        stretch
+test-amd64-coresched-amd64-xl kernbuildjob        build-amd64-pvops
+test-amd64-coresched-i386-xl  kernbuildjob        build-i386-pvops
+test-amd64-coresched-amd64-xl kernkind            pvops
+test-amd64-coresched-i386-xl  kernkind            pvops
+test-amd64-coresched-amd64-xl toolstack           xl
+test-amd64-coresched-i386-xl  toolstack           xl
+test-amd64-coresched-amd64-xl xen_boot_append     sched-gran=core
+test-amd64-coresched-i386-xl  xen_boot_append     sched-gran=core
+test-amd64-coresched-amd64-xl xenbuildjob         build-amd64
+test-amd64-coresched-i386-xl  xenbuildjob         build-amd64

---
Changes since v2:
- Use hw-smt instead of smt as hostflag.

---
 make-flight | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
make-flight +20 -0
index 2f445d95..a361bcb1 100755
@@ -763,6 +763,17 @@ test_matrix_do_one () {
   *)                test_dom0pvh=n ;;
   esac
 
+  # core scheduling tests for versions >= 4.13 only
+  case "$xenbranch" in
+  xen-3.*-testing)  test_coresched=n ;;
+  xen-4.?-testing)  test_coresched=n ;;
+  xen-4.10-testing) test_coresched=n ;;
+  xen-4.11-testing) test_coresched=n ;;
+  xen-4.12-testing) test_coresched=n ;;
+  *)                test_coresched=y ;;
+  esac
+
+
   # xend PV guest test on x86 only
   if [ x$test_xend = xy -a \( $dom0arch = "i386" -o $dom0arch = "amd64" \) ]; then
     job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
@@ -894,6 +905,15 @@ test_matrix_do_one () {
 
   fi
 
+  # Core-scheduling tests are x86 only
+  if [ x$test_coresched = xy -a $xenarch = amd64 ]; then
+    job_create_test test-$xenarch$kern-coresched-$dom0arch-xl \
+                    test-debian xl $xenarch $dom0arch $debian_runvars \
+                    all_hostflags=$most_hostflags,hw-smt \
+                    xen_boot_append='sched-gran=core'
+
+  fi
+
   #do_passthrough_tests
 
   do_pygrub_tests
Signature · 1 line
2.26.0
#2 lore raw

Re: [PATCH OSSTEST v3 2/2] make-flight: add a core scheduling job

Roger Pau Monne writes ("[PATCH OSSTEST v3 2/2] make-flight: add a core scheduling job"):

Quoted 2 lines

Run a simple core scheduling tests on a host that has SMT support. This is only enabled for Xen >= 4.13.

Thanks, pushed to pretest.

Once it makes it through staging the test will appear, but it will start failing (nonblockingly) until the SMT hostflag has been scanned. It would be sensible for me to run a special examine job for that.

Ian.

#3 lore raw

Re: [PATCH OSSTEST v3 2/2] make-flight: add a core scheduling job

Quoted 9 lines · Ian Jackson

Roger Pau Monne writes ("[PATCH OSSTEST v3 2/2] make-flight: add a core scheduling job"):

Quoted 2 lines

Run a simple core scheduling tests on a host that has SMT support. This is only enabled for Xen >= 4.13.

Thanks, pushed to pretest.

Once it makes it through staging the test will appear, but it will start failing (nonblockingly) until the SMT hostflag has been scanned. It would be sensible for me to run a special examine job for that.

Yes, I think so. Will try to keep an eye and ping you when it passes osstest self push gate.

Thanks, Roger.