1#! /bin/sh 2# 3# Copyright (c) International Business Machines Corp., 2001 4# Author: Nageswara R Sastry <nasastry@in.ibm.com> 5# 6# This program is free software; you can redistribute it and#or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 2 of the License, or 9# (at your option) any later version. 10# 11# This program is distributed in the hope that it will be useful, but 12# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14# for more details. 15# 16# You should have received a copy of the GNU General Public License 17# along with this program; if not, write to the Free Software Foundation, 18# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19# 20 21export TCID="Power_Management_exclusive04" 22export TST_TOTAL=2 23 24. test.sh 25. pm_include.sh 26 27# Checking test environment 28check_kervel_arch 29 30tst_require_cmds python3 31 32hyper_threaded=$(is_hyper_threaded) 33multi_socket=$(is_multi_socket) 34if [ $hyper_threaded -ne 0 -o $multi_socket -ne 0 ]; then 35 tst_brkm TCONF "System is not a multi socket & hyper-threaded" 36fi 37 38# Verify threads consolidation stops when sched_smt is 39# disabled in HT systems. 40# Vary only sched_smt from 1 to 0 when workload is running 41# and ensure that tasks do not consolidate to single core 42# when sched_smt is set to 0. 43if pm_cpu_consolidation.py -v -t 1; then 44 tst_resm TPASS "CPU consolidation test by varying sched_smt from 1 to 0" 45else 46 tst_resm TFAIL "CPU consolidation test by varying sched_smt from 1 to 0" 47fi 48 49# Vary only sched_smt from 2 to 0 when workload is running 50# and ensure that tasks do not consolidate to single core 51# when sched_smt is set to 0. 52if pm_cpu_consolidation.py -v -t 2; then 53 tst_resm TPASS "CPU consolidation test by varying sched_smt from 2 to 0" 54else 55 tst_resm TFAIL "CPU consolidation test by varying sched_smt from 2 to 0" 56fi 57 58tst_exit 59