Online cores at X20


#1

Hello,

I want to online all the cores at the X20 to run some experiments.
I connect with adb shell to the device and the n I try to bring up the cores.
However, if I try echo 1 > /sys/devices/system/cpu/cpu1/online nothing really happens (i guess some power saving settings overwrite it).
The same happens for the rest of the cores as well apart from cpu0.
Do you know how I can overcome this?

Cheers,
Jo


#2

The X20 kernel contains code to automatically plug/unplug CPUs. To change that you’d have to dig through the kernel sources and disable this (you may also have to replace it with alternative thermal management to stop the chip resetting if it starts to heat up with all ten cores running).


#3

Thank you very much for your reply.
Do you know if there is any documentation for the changes made in the X20 kernel?

Cheers,
Jo


#4

[ioanna] ioanna http://discuss.96boards.org/u/ioanna
June 21

Thank you very much for your reply.
Do you know if there is any documentation for the changes made in the
X20 kernel?

I don’t think there are any docs on this sort of thing. You just have
the kernel. I think you might see the decision making in the dmesg
logs… and if you can see the decision making then you can go from
there to the right bit of code using grep :wink:


#5

Thanks for this, I followed what you suggested.
Mediatek implemented their own hotplug strategy (hps).
Luckily for me, they expose it through procfs, so it can be enabled and disabled from /proc/hps,
then cores can be onlined/offlined manually.

Cheers,
Jo


#6

can you let me know the exact commands?
thanks


#7

First you need to disable the hotplug strategy(hps).
You can do this from /proc :
echo 0 > /proc/hps/enabled
Then you can take the cores online/offline from /sys/devices/system/cpu/cpu$/online
So, if you want to take online core 5 :
echo 1 > /sys/devices/system/cpu/cpu5/online


Odroid XU4(Cortex A15) vs HiKey 960(A73) speed
#8

seems like my understanding of big.LITTLE is a bit flawed, I did enable all cores and the system monitor did show all of them enabled, BUT the benchmarks barely changed.
I was expecting a huge bump in the geekbench multi-core benchmark and also on other cpu bound benchmarks due to the fact that all 8 cores are now available, but they didn’t had much effect only a little bit, and that I guess is due to the fact that background tasks weren’t hogging the big cores cpu time as much as all the cores were available for other processes.
Can some one explain the reason behind it, are the multi core tasks being scheduled differently than on a regular Linux system ?


#9

To be honest, I ve never used geekbench, so I don’ t know which parts of the system it stresses or how many threads it spawns.
Which board are you using ? Mediatek X20 has 10 cores not 8, where actually only 2 are the big ones.
Beware of the overheating.
Big cores are power hungry and tend to overheat, this leads to throttling the frequency or migrate the thread to a little core for the chip not to burn.
How exactly these decisions are made depends on the scheduler, the cpufreq and thermal subsystems plus any other power management scheme implemented.
Linux kernel for big.LITTLE systems is a bit different for the mainline in order to support big little. Plus each company implement their own extra stuff.
For example Mediatek and Qualcomm implement different scheduling and power management policies.
If you provide more detail about how you run the benchmarks and which benchmarks are they, I may be able to help more.
Do you pin the benchmark to specific cores? Do you control the frequency? Or you let the operating system take care of these?


#10

Yes on the x20 and i meant to say 10 cores. I simply just enabled all the cores as you mentioned in the above thread, and let the OS take care of the rest. GeekBench is a multi-platform benchmarking util and has both single and multi core mode, it scales extremely well on multi-core, like on xeon processors.


#11

I don’t really know what to expect with an X20 but I certainly wouldn’t expect performance to scale with cores like it does on server and workstation CPUs.

This is almost all down to heat dissipation. A server chip is typically attached to a big heat sink and the resulting thermal system is designed to draw sufficient heat away from the CPU to keep it running at its full speed. A phone chip is different. Speaking approximately, it is given a temperature limit and the CPU is allowed to run at full speed until the limit is reach at which point it will regulate the processor speed to maintain the SOC at or near the temperature limit.

So when you run benchmark on an X20 the scheduler and the thermal manager will be doing their best to get the best performance possible from the silicon, dynamically tuning things based on temperature readings and estimated CPU utilisation.

If these dynamic tunings were perfect (they are not and will not ever be; they can be good but they will never be perfect) it would be impossible to improve the GeekBench performance by enabling more cores precisely because the dynamic tuning would already have selected the right number of cores to maximise performance.

Or put another way, if you did see a significant performance uplift by turning off PM features (like automatic CPU hotplug), that would typically evidence of a badly tuned base system. It would not be a good thing!