Bug 1379907

Summary: RFE: Add configuration to set default system SMT mode
Product: Red Hat Enterprise Linux 7 Reporter: David Gibson <dgibson>
Component: powerpc-utilsAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: dhorak, multi-arch-mgr, ovasik, qzhang, secondary-arch-list, than
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: powerpc-utils-1.3.4-11.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:46:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1780582    

Description David Gibson 2016-09-28 04:09:10 UTC
Description of problem:

Modern POWER CPUs support hardware multi-threading (similar to hyperthreading on x86) - up to 4 threads on POWER7 and up to 8 threads on POWER8.

Which threading mode gives the best performance can vary with the workload.  Therefore depending on the system's typical workload it might be useful to have it default to a particular threading mode on boot.

The ppc64_cpu tool included in the powerpc-utils package allows the threading mode to be changed at runtime (for both bare metal systems, and PowerVM or KVM guests), but there's no convenient config file to set the mode which will be used at boot, meaning the kernel will always default to the maximum number of threads.

We should add a configuration file and init scripts which allows the default threading mode for a newly booted system to be chosen.


Additional info:

Note that the qemu-kvm-rhev package currently installs configuration to force SMT off (i.e. 1 thread per core) this is necessary in order to run KVM guests.  Whatever method we use for general configuration will need to work with that.

Comment 1 Josh Boyer 2016-09-28 12:12:08 UTC
David, do you have a similar issue opened against upstream powerpc-utils?  If so, could you please provide a link here?

Comment 12 Than Ngo 2020-03-16 12:08:34 UTC
it's fixed in powerpc-utils-1.3.4-11.el7

Comment 15 Jeff Bastian 2020-06-18 16:42:21 UTC
Verified with powerpc-utils-1.3.4-14.el7 in RHEL 7.9


[root@ibm-p8-01-lp2 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 Beta (Maipo)

[root@ibm-p8-01-lp2 ~]# rpm -q kernel powerpc-utils
kernel-3.10.0-1150.el7.ppc64le
powerpc-utils-1.3.4-14.el7.ppc64le

[root@ibm-p8-01-lp2 ~]# ppc64_cpu --smt
SMT=8

[root@ibm-p8-01-lp2 ~]# rpm -ql powerpc-utils | grep systemd
/usr/lib/systemd/system/smt_off.service

[root@ibm-p8-01-lp2 ~]# systemctl enable smt_off.service
Created symlink from /etc/systemd/system/multi-user.target.wants/smt_off.service to /usr/lib/systemd/system/smt_off.service.

[root@ibm-p8-01-lp2 ~]# reboot
...

[root@ibm-p8-01-lp2 ~]# systemctl status smt_off.service
● smt_off.service - ppc64 set SMT off
   Loaded: loaded (/usr/lib/systemd/system/smt_off.service; enabled; vendor preset: disabled)
   Active: active (exited) since Thu 2020-06-18 12:27:26 EDT; 39s ago
  Process: 1096 ExecStart=/usr/sbin/ppc64_cpu --smt=off (code=exited, status=0/SUCCESS)
 Main PID: 1096 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/smt_off.service

Jun 18 12:27:26 ibm-p8-01-lp2.khw1.lab.eng.bos.redhat.com systemd[1]: Startin...
Jun 18 12:27:26 ibm-p8-01-lp2.khw1.lab.eng.bos.redhat.com systemd[1]: Started...
Hint: Some lines were ellipsized, use -l to show in full.

[root@ibm-p8-01-lp2 ~]# ppc64_cpu --smt
SMT is off

[root@ibm-p8-01-lp2 ~]# systemctl disable smt_off.service
Removed symlink /etc/systemd/system/multi-user.target.wants/smt_off.service.

[root@ibm-p8-01-lp2 ~]# reboot
...

[root@ibm-p8-01-lp2 ~]# systemctl status smt_off.service
● smt_off.service - ppc64 set SMT off
   Loaded: loaded (/usr/lib/systemd/system/smt_off.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

[root@ibm-p8-01-lp2 ~]# ppc64_cpu --smt
SMT=8

Comment 18 errata-xmlrpc 2020-09-29 19:46:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (powerpc-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3893