First impressions with cpufreq stuff in Kernel 4.x
9
9892
|
View: 9892|Reply: 9
|
[NAS]
First impressions with cpufreq stuff in Kernel 4.x
[Copy link]
|
|
|
Edited by tkaiser at Mon Jun 29, 2015 11:23
I made a small comparison with LeMaker's 'Raspbian For BananaPi v1412' image:
The main differences compared to a NAS-friendly setup with Mainline kernel:
- LeMaker still uses somewhat weird cpufreq settings ('fantasy' governor and clock speed between 720 and 912 MHz)
- Kernel 3.4.103 instead of 4.x
- Since the Raspbian image uses Raspbian repositories that were made for the real Raspberry Pis code of both applications and libraries is not ARMv7 optimised (but ARMv6 instead)
- Memory reservation for GPU (MemTotal 895380 kB according to /proc/meminfo). This doesn't influenced the benchmarks but might make a difference in real-world scenarios since the less RAM available the less RAM can be used for file caches/buffers
- Since btrfs in kernel 3.4 wasn't ready for prime time I had to rely on ext4 for tests
Result's with LeMaker's default settings:
I used my usual setup (connecting an EVO 840 SSD to the Banana Pi's SATA port) and the usual iozone/iperf/LanTest approaches (see this thread or other pinned threads in this subforum):
iozone -a -g 2000m -s 2000m -i 0 -i 1 -r4k:
default fantasy 720/912 MHz: 42MB/s write, 142MB/s read
optimised settings (ondemand 1056 MHz): 43MB/s write, 175MB/s read
iperf between BPi and MacBook Pro:
default fantasy governor (720-912 MHz): 400 Mbits/sec TX, 650 Mbits/sec RX
optimised settings (ondemand 1056 MHz): 425 Mbits/sec TX, 780 Mbits/sec RX
With "Optimised settings" I refer to these (adjusting cpufreq settings, assigning eth0 interrupts to the second CPU core and some TCP/IP stack tuning for Gbit networking):
- echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
- echo 1056000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
- echo 408000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
- echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
- echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
- echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
- echo 2 >/proc/irq/$(awk -F":" '/eth0/ {print $1}' </proc/interrupts)/smp_affinity
- sysctl -w net/core/rmem_max=8738000
- sysctl -w net/core/wmem_max=6553600
- sysctl -w net/ipv4/tcp_rmem="8192 873800 8738000"
- sysctl -w net/ipv4/tcp_wmem="4096 655360 6553600"
- sysctl -w vm/min_free_kbytes=65536
- sysctl -w net.ipv4.tcp_window_scaling=1
- sysctl -w net.ipv4.tcp_timestamps=1
- sysctl -w net.ipv4.tcp_sack=1
- sysctl -w net.ipv4.tcp_no_metrics_save=1
- sysctl -w net.core.netdev_max_backlog=5000
- ip link set eth0 txqueuelen 10000
Copy the Code
Please remember: With mainline, optimised kernel settings, slight overclocking and software optimised for ARMv7 we were able to get 750 Mbits/sec TX, 940 Mbits/sec RX with iperf and with iozone approx. 47MB/s SATA write througput (using exactly the same Banana Pi with exactly the same SSD connected and nearly the identical 'tunables' above).
In combined benchmarks that utilise both network and storage at the same time results differ even more:
"Raspbian for Banana Pi" defaults (28MB/sec write, 45MB/sec read):

"Raspbian for Banana Pi" with optimised settings and cpufreq of 960MHz (32MB/sec write, 45MB/sec read):

"Raspbian for Banana Pi" with optimised settings and cpufreq of 1056MHz (34MB/sec write, 51MB/sec read):

Using Mainline, ARMv7 optimised binaries and an Armbian image we were able to get over 15MB/s (write) and almost 30MB/s (read) more than with Raspbian's default settings. On identical hardware. This shows how important correct settings are on such slow platforms like small A20 based devices.
|
|
|
|
|
|
|
|
|
|
|
|
Hi tkaiser, do you mind to share your armbian main line kernel with overclocking on mode? |
|
|
|
|
|
|
|
|
|
|
Edited by tkaiser at Mar 18, 2016 05:01
Of course I won't. The idea to 'overclock' an A20 device with untested settings is already a bit insane since these 'tablet grade' SoCs aren't tested at the factory. Then increasing the cpufreq isn't the most important stuff and choosing a SoC that is made for NAS useage is the best idea.
Please read carefully through http://linux-sunxi.org/Hardware_ ... Ffrequency_settings and http://linux-sunxi.org/Sunxi_dev ... _on_NAS_performance to get the idea what has to be considered when trying to increase clockspeeds and why replacing the kernel in an otherwise crappy OS image won't help.
Replacing one kernel with another is always wrong, especially since Armbian provides a fully functional build system. So set up a virtual machine with Ubuntu 16.04 LTS, follow the steps outlined here http://www.armbian.com/using-armbian-tools/ throw the following at the right place in the 'userpatches' dir and you can do any harm to your A20 device that you want (but you're still able to adjust the DVFS settings on your own since the Armbian build system creates simple to install .debs with your settings):
- diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
- index e02eb72..7266c9a 100644
- --- a/arch/arm/boot/dts/sun7i-a20.dtsi
- +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
- @@ -102,6 +102,11 @@
- clock-latency = <244144>; /* 8 32k periods */
- operating-points = <
- /* kHz uV */
- + 1200000 1500000
- + 1152000 1500000
- + 1104000 1450000
- + 1056000 1450000
- + 1008000 1450000
- 960000 1400000
- 912000 1400000
- 864000 1300000
Copy the Code BTW: Please don't expect that I read answers in this useless forum, I stumbled accross your post more by accident and will not get back to any answers anytime soon 
|
|
|
|
|
|
|
|
|
|
|
|
@tkaiser any patches for 4.6.x kernel? I can't get it work for banana pi m1 |
|
|
|
|
|
|
|
|
|
|
|
Kernel was the most difficult software in my field that have different command and I need to get latest version of this to run the commands. I need to know about the command of this that I got from uk essays writing this was able to have all this that was good to have this it has all the codes in it. |
|
|
|
|
|
|
|
|
|
|
I am quite impressed with cpufreq tool in Kernel 4.x, the article is very detailed, showing the effects and benefits of the tool.
fnaf world |
|
|
|
|
|
|
|
|