Le 17/02/2022 à 08:04, Joel Stanley a écrit :
x86 added a control for turning SMT on and off in commit 05736e4ac13c
("cpu/hotplug: Provide knobs to control SMT").
Implement this for powerpc as an alternative to the currently method of
iterating through /sys/devices/system/cpu/cpuN/online for every CPU.
# ppc64_cpu --info
Core 0: 0* 1* 2* 3* 4* 5* 6* 7*
Core 1: 8* 9* 10* 11* 12* 13* 14* 15*
# grep . /sys/devices/system/cpu/smt/*
/sys/devices/system/cpu/smt/active:1
/sys/devices/system/cpu/smt/control:on
# echo off > /sys/devices/system/cpu/smt/control
# ppc64_cpu --info
Core 0: 0* 1 2 3 4 5 6 7
Core 1: 8* 9 10 11 12 13 14 15
# grep . /sys/devices/system/cpu/smt/*
/sys/devices/system/cpu/smt/active:0
/sys/devices/system/cpu/smt/control:off
Signed-off-by: Joel Stanley <joel@jms.id.au>
Build fails with corenet64_smp_defconfig:
CC kernel/cpu.o
kernel/cpu.c: In function 'cpuhp_smt_disable':
kernel/cpu.c:2220:23: error: implicit declaration of function
'cpu_down_maps_locked' [-Werror=implicit-function-declaration]
2220 | ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: kernel/cpu.o] Error 1
Christophe