How to turn off CPU cores on Samsung Galaxy A8?
0
votes
1
answer
1406
views
I need to turn off CPU cores in order to make energy measurements of sets of cpu cores in isolation (meaning that I want to run an application on a set of cpu cores and turn off the cpu cores that are not in the set). I looked at the documentation on the [android linux kernel source](https://android.googlesource.com/kernel/common/+/refs/heads/android-4.4-p/Documentation/cpu-hotplug.txt) and it says the following:
> Q: How do i logically offline a CPU?
A: Do the following.
Once the logical offline is successful, check
You should now not see the CPU that you removed. Also online file will report the state as 0 when a cpu if offline and 1 when its online.
#To display the current cpu state.
But when I write 0 to the online file, it still reports the CPU as being online even with superuser permissions and marking the file as writable (
**Model:** Samsung Galaxy A8 (SM-A530F)
**Android Version:** Android Pie (9)
**Kernel:** Quantum Kernel V4
**Kernel version:** 4.4.111-Quantum_pie.V4.0-A530F
**Processor:** Samsung Exynos Octa 7885
**Architecture:** aarch64
EDIT: Forgot to mention that my device is rooted.
A: Do the following.
#echo 0 > /sys/devices/system/cpu/cpuX/online
Once the logical offline is successful, check
#cat /proc/interrupts
You should now not see the CPU that you removed. Also online file will report the state as 0 when a cpu if offline and 1 when its online.
#To display the current cpu state.
#cat /sys/devices/system/cpu/cpuX/online
But when I write 0 to the online file, it still reports the CPU as being online even with superuser permissions and marking the file as writable (
chmod +w
).
I imagine that the kernel is enabling the cpu again after I disabled it. Also I did not try to turn off CPU 0 because in the same documentation it says that it's not removable in some architectures, this behavior is happening on other CPUs.
Do I need to rebuild the kernel in order to enable the cpu hotplug or is this an architecture specific problem? Maybe my cpu doesn't support hotplugs.
**What I've tried by now**
- Writing to /sys/devices/system/cpu/cpuN/online
with a rooted device. (echo "0" > ./sys/device/...../online
)
- Changing the kernel to a custom one and trying the step above again. (Kernel installed was Quantum Kernel)
- Using [kernel adiutor](https://play.google.com/store/apps/details?id=com.grarak.kerneladiutor&hl=en) to turn off the CPUs on the CPU tab (this turns off the CPU for a while then it turns back on again)
- Using su on adb shell to change file permissions on sysfs (chmod 664 /sys/devices/...../online
) and then trying to write to it.
**Device Information** **Model:** Samsung Galaxy A8 (SM-A530F)
**Android Version:** Android Pie (9)
**Kernel:** Quantum Kernel V4
**Kernel version:** 4.4.111-Quantum_pie.V4.0-A530F
**Processor:** Samsung Exynos Octa 7885
**Architecture:** aarch64
EDIT: Forgot to mention that my device is rooted.
Asked by Eduardo macedo
(111 rep)
Oct 7, 2019, 03:48 PM
Last activity: Jul 7, 2020, 12:08 AM
Last activity: Jul 7, 2020, 12:08 AM