Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2023-08-17 19:42:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerpc-utils" Thu Aug 17 19:42:48 2023 rev:138 rq:1104191 version:1.3.11 Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2023-06-07 23:05:46.390768896 +0200 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.1766/powerpc-utils.changes 2023-08-17 19:42:51.598712445 +0200 @@ -1,0 +2,6 @@ +Tue Aug 15 13:07:50 UTC 2023 - Michal Suchanek <[email protected]> + +- Tell kernel about the SMT value set by ppc64_cpu (bsc#1214285 bsc#1205462 ltc#200161 ltc#200588). + + ppc64_cpu-Support-partial-SMT-level-through-SYS-FS-s.patch + +------------------------------------------------------------------- New: ---- ppc64_cpu-Support-partial-SMT-level-through-SYS-FS-s.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.lE2q7s/_old 2023-08-17 19:42:52.454714046 +0200 +++ /var/tmp/diff_new_pack.lE2q7s/_new 2023-08-17 19:42:52.462714061 +0200 @@ -32,6 +32,7 @@ Patch5: lparstat-Fix-negative-values-seen-while-running-lpar.patch Patch6: lparstat-report-mixed-SMT-state.patch Patch7: lparstat-Fix-offline-threads-uninitialized-entries.patch +Patch8: ppc64_cpu-Support-partial-SMT-level-through-SYS-FS-s.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libnuma-devel ++++++ ppc64_cpu-Support-partial-SMT-level-through-SYS-FS-s.patch ++++++ >From 46c524be975a108d2b8d1cadb95003b9c2670c8e Mon Sep 17 00:00:00 2001 From: Laurent Dufour <[email protected]> Date: Thu, 29 Jun 2023 16:41:37 +0200 Subject: [PATCH] ppc64_cpu: Support partial SMT level through SYS FS smt/control files The next kernel release will support partial SMT level [1] though the SYS FS file "devices/system/cpu/smt/control". This allows the SMT level to be recorded in the kernel. With the current SMT level stored in the kernel, when a new CPU is added, only the necessary threads are brought online. The legacy way to active threads through the SYS FS files 'devices/system/cpu/cpu<n>/online', is still used in the case the new SYS FS API is not available. This allows compatibility with the previous kernel versions. [1] https://lore.kernel.org/linuxppc-dev/[email protected]/ Signed-off-by: Laurent Dufour <[email protected]> --- src/ppc64_cpu.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index 5fdf86a..c33a293 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -56,6 +56,8 @@ #define DIAGNOSTICS_RUN_MODE 42 #define CPU_OFFLINE -1 +#define SYS_SMT_CONTROL "/sys/devices/system/cpu/smt/control" + #ifdef HAVE_LINUX_PERF_EVENT_H struct cpu_freq { int offline; @@ -360,6 +362,20 @@ static int is_dscr_capable(void) return 0; } +/* + * Depends on kernel's CONFIG_HOTPLUG_CPU + */ +static int set_smt_control(int smt_state) +{ + if (set_attribute(SYS_SMT_CONTROL, "%d", smt_state)) { + /* Silently ignore kernel not supporting this feature */ + if (errno != ENODEV) + perror(SYS_SMT_CONTROL); + return -1; + } + return 0; +} + static int do_smt(char *state, bool numeric) { int rc = 0; @@ -388,7 +404,9 @@ static int do_smt(char *state, bool numeric) return -1; } - rc = set_smt_state(smt_state); + /* Try using smt/control if failing, fall back to the legacy way */ + if (set_smt_control(smt_state)) + rc = set_smt_state(smt_state); } return rc; -- 2.41.0
