Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pinebookpro-kernel: overclock patch #28007

Closed
wants to merge 1 commit into from

Conversation

thypon
Copy link
Member

@thypon thypon commented Jan 18, 2021

Pinebook PRO uses the same OP1 RK3399 of many other chromebooks devices.
These devices has been rated for 2.1Ghz max clock speed.
Use the OP1 profile already present in the kernel tree.

@ericonr @CameronNemo

@depau
Copy link

depau commented Jan 18, 2021

Overclocking related issues are super hard to isolate and bisect, especially on a machine that already has other issues.

Why merge this into the main kernel package when you can simply ship an overlay and instruct users on how to apply it and stress-test their own silicon? It's literally 1 line in the u-boot boot script.

Silicon lottery applies to RK3399 too. If Google has their SoCs tested to be able to reach higher clock speeds, good for them. Does Pine64 have them tested for higher clocks? I don't think so.

@Johnnynator
Copy link
Member

^ this, we imo should keep the defaults.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

I'll leave it here and test a couple of weeks.
Consider that all the kernel that we shipped until 5.8 was implicitly having even a steeper overclock profile.
Tsys kernels we were shipping since an year is .1ghz and .15v higher than even the official OP1 profile shipped in chrome books.

When we upgraded from tsys to this mainline we downclocked all our users of 0.3Ghz.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

Compiled the kernel 3 times, in an evironment with stable 22.5 degrees and 50% humidity. The temperature was in the 60s degree range, with 61/62 peak with the OP1 profile.

Interestingly the pinebook pro never crashed while on the same test with the non-OP1 profile (underclock), crashed once in 3 run.

Powersupply connected in both cases.

@CameronNemo
Copy link
Contributor

Has this been submitted upstream? What did the rockchip maintainers have to say about it?

@depau thanks for the tip

I am willing to roll the dice and throw this on my book, but I agree with the others that we should be striving to get closer to a vanilla kernel, not farther. You may have also noticed that the 5.7 tsys kernel had altmode support, and the newer kernels Void ships do not. The altmode patches are much deeper than dts tweaks, though.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

Not yet, I would like to do a distribution-wide test before sending this upstream. And the odds of being distructive is very remote on the pinebook, given that tsys was using a stronger overclock.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

I'm running benchmarks over benchmarks right now, and, if I can say something, the pinebook seems more responsive and stable than before.

@CameronNemo
Copy link
Contributor

@thypon how does it affect power consumption. I know that excessive power consumption (even with the barrel charger plugged in) has been an issue. Especially when using an SSD.

@depau
Copy link

depau commented Jan 18, 2021

I'm running benchmarks over benchmarks right now, and, if I can say something, the pinebook seems more responsive and stable than before.

Your Pinebook.

Again, the device clearly has many other issues and crashes, and until every issue has been bisected and identified you can't be 100% sure that the problems aren't caused by overclocking.

RK3399 chips are real life objects, and as such no chip is made equal and not all chips will run stably at the same high frequencies. Since users will most likely NOT be aware that their device is being overclocked/undervolted/overvolted/anything unless they read the DTS, they will most likely blame it on faulty hardware rather than faulty settings.

Devices crash with tsys' kernel too. If yours doesn't, then you won the silicon lottery, good for you.

I suggest to stick with what rockchip does for mainstream RK3399 - not for Chromebooks - and with whatever Rockchip has tested and guarantees when they sell the chips to their customers.

But most importantly - and I can't stress this enough - I do not think it is a good idea to imply that since it runs smoothly on your particular device it will run smoothly on everyone else's device. Run it on 100 devices, stress test them continuously with a synthetic workload for 24h and see if any of them crashes. I seriously doubt they will all pass the test.

Yes, it is fair to stress test them with a synthetic workload because you want devices to never crash, not to not crash when you're "just compiling Linux".

If it runs fine on your machine you can always add an overlay, it's free open-source software.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

@thypon how does it affect power consumption. I know that excessive power consumption (even with the barrel charger plugged in) has been an issue. Especially when using an SSD.

I tested with power cord on. That really depends on the usage. Do you want me to do a battery time test from 100 to 0? Or watt usage? Watt usage is below 12w for me.

The problem is that I have a very power efficient nvme, since I bought the less power hungry (nvme) available, but that may not apply to everybody.

The barrel charger is known for not to be able to provide enough energy even with no overclock, but this is a problem due to power hungry PCIe devices imho.

After applying the patch, it is possible to disable the 2.01ghz extra step with /sys, so I don't see a huge problem (if it does not crash in most cases). Disabling it requires only an 'echo', enabling dtb or dto compilation and loading through uboot.

@thypon
Copy link
Member Author

thypon commented Jan 18, 2021

Same kernel, no external load, on the left without patch, on the right, with the patch:

   BYTE UNIX Benchmarks (Version 5.1.3)						   BYTE UNIX Benchmarks (Version 5.1.3)
										
   System: pinebook: GNU/Linux							   System: pinebook: GNU/Linux
   OS: GNU/Linux -- 5.10.2_1 -- #1 SMP Sat Dec 26 07:43:49 UTC 2020		   OS: GNU/Linux -- 5.10.2_1 -- #1 SMP Sun Jan 17 15:29:39 UTC 2021
   Machine: aarch64 (unknown)							   Machine: aarch64 (unknown)
   Language: en_US.UTF-8 (charmap="UTF-8", collate="ANSI_X3.4-1968")		   Language: en_US.UTF-8 (charmap="UTF-8", collate="ANSI_X3.4-1968")
   20:04:34 up 0 min,  1 user,	load average: 0.71, 0.20, 0.07; runlevel	   21:12:53 up 0 min,  1 user,	load average: 0.92, 0.27, 0.09; runlevel
										
------------------------------------------------------------------------	------------------------------------------------------------------------
Benchmark Run: Mon Jan 18 2021 20:04:34 - 20:32:53				Benchmark Run: Mon Jan 18 2021 21:12:53 - 21:41:10
6 CPUs in system; running 1 parallel copy of tests				6 CPUs in system; running 1 parallel copy of tests
										
Dhrystone 2 using register variables	   15568589.9 lps   (10.0 s, 7 samples) Dhrystone 2 using register variables	   17397260.0 lps   (10.0 s, 7 samples)
Double-Precision Whetstone		       2898.7 MWIPS (9.9 s, 7 samples)	Double-Precision Whetstone		       3246.7 MWIPS (10.0 s, 7 samples)
Execl Throughput			       1710.0 lps   (29.9 s, 2 samples) Execl Throughput			       1887.2 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks	     320144.5 KBps  (30.0 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks	     328156.5 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks	     136773.2 KBps  (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks	     137994.9 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks	     796414.7 KBps  (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks	     779525.1 KBps  (30.0 s, 2 samples)
Pipe Throughput				     622135.6 lps   (10.0 s, 7 samples) Pipe Throughput				     684346.5 lps   (10.0 s, 7 samples)
Pipe-based Context Switching		      34710.1 lps   (10.0 s, 7 samples) Pipe-based Context Switching		      34089.0 lps   (10.0 s, 7 samples)
Process Creation			       1657.4 lps   (30.0 s, 2 samples) Process Creation			       1642.8 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)		       1668.0 lpm   (60.0 s, 2 samples) Shell Scripts (1 concurrent)		       1707.0 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)			682.8 lpm   (60.1 s, 2 samples) Shell Scripts (8 concurrent)			714.1 lpm   (60.0 s, 2 samples)
System Call Overhead			     625773.8 lps   (10.0 s, 7 samples) System Call Overhead			     675789.6 lps   (10.0 s, 7 samples)
										
System Benchmarks Index Values		     BASELINE	    RESULT    INDEX	System Benchmarks Index Values		     BASELINE	    RESULT    INDEX
Dhrystone 2 using register variables	     116700.0	15568589.9   1334.1	Dhrystone 2 using register variables	     116700.0	17397260.0   1490.8
Double-Precision Whetstone			 55.0	    2898.7    527.0	Double-Precision Whetstone			 55.0	    3246.7    590.3
Execl Throughput				 43.0	    1710.0    397.7	Execl Throughput				 43.0	    1887.2    438.9
File Copy 1024 bufsize 2000 maxblocks	       3960.0	  320144.5    808.4	File Copy 1024 bufsize 2000 maxblocks	       3960.0	  328156.5    828.7
File Copy 256 bufsize 500 maxblocks	       1655.0	  136773.2    826.4	File Copy 256 bufsize 500 maxblocks	       1655.0	  137994.9    833.8
File Copy 4096 bufsize 8000 maxblocks	       5800.0	  796414.7   1373.1	File Copy 4096 bufsize 8000 maxblocks	       5800.0	  779525.1   1344.0
Pipe Throughput				      12440.0	  622135.6    500.1	Pipe Throughput				      12440.0	  684346.5    550.1
Pipe-based Context Switching		       4000.0	   34710.1     86.8	Pipe-based Context Switching		       4000.0	   34089.0     85.2
Process Creation				126.0	    1657.4    131.5	Process Creation				126.0	    1642.8    130.4
Shell Scripts (1 concurrent)			 42.4	    1668.0    393.4	Shell Scripts (1 concurrent)			 42.4	    1707.0    402.6
Shell Scripts (8 concurrent)			  6.0	     682.8   1138.0	Shell Scripts (8 concurrent)			  6.0	     714.1   1190.2
System Call Overhead			      15000.0	  625773.8    417.2	System Call Overhead			      15000.0	  675789.6    450.5
								   ========									   ========
System Benchmarks Index Score					      504.8	System Benchmarks Index Score					      528.4
										
------------------------------------------------------------------------	------------------------------------------------------------------------
Benchmark Run: Mon Jan 18 2021 20:32:53 - 21:01:24				Benchmark Run: Mon Jan 18 2021 21:41:10 - 22:09:50
6 CPUs in system; running 6 parallel copies of tests				6 CPUs in system; running 6 parallel copies of tests
										
Dhrystone 2 using register variables	   53911054.8 lps   (10.0 s, 7 samples) Dhrystone 2 using register variables	   58873810.6 lps   (10.0 s, 7 samples)
Double-Precision Whetstone		      11991.7 MWIPS (9.1 s, 7 samples)	Double-Precision Whetstone		      13045.5 MWIPS (9.1 s, 7 samples)
Execl Throughput			       4054.1 lps   (29.8 s, 2 samples) Execl Throughput			       4108.0 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks	     520939.9 KBps  (30.0 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks	     552967.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks	     160364.2 KBps  (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks	     169673.2 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks	    1205983.6 KBps  (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks	    1250550.4 KBps  (30.0 s, 2 samples)
Pipe Throughput				    2612652.8 lps   (10.0 s, 7 samples) Pipe Throughput				    2568725.5 lps   (10.0 s, 7 samples)
Pipe-based Context Switching		     287447.5 lps   (10.0 s, 7 samples) Pipe-based Context Switching		     304515.1 lps   (10.0 s, 7 samples)
Process Creation			       7145.8 lps   (30.0 s, 2 samples) Process Creation			       7288.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)		       6889.4 lpm   (60.0 s, 2 samples) Shell Scripts (1 concurrent)		       7102.5 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)			892.5 lpm   (60.1 s, 2 samples) Shell Scripts (8 concurrent)			915.0 lpm   (60.2 s, 2 samples)
System Call Overhead			    2264621.6 lps   (10.0 s, 7 samples) System Call Overhead			    2316609.4 lps   (10.0 s, 7 samples)
										
System Benchmarks Index Values		     BASELINE	    RESULT    INDEX	System Benchmarks Index Values		     BASELINE	    RESULT    INDEX
Dhrystone 2 using register variables	     116700.0	53911054.8   4619.6	Dhrystone 2 using register variables	     116700.0	58873810.6   5044.9
Double-Precision Whetstone			 55.0	   11991.7   2180.3	Double-Precision Whetstone			 55.0	   13045.5   2371.9
Execl Throughput				 43.0	    4054.1    942.8	Execl Throughput				 43.0	    4108.0    955.4
File Copy 1024 bufsize 2000 maxblocks	       3960.0	  520939.9   1315.5	File Copy 1024 bufsize 2000 maxblocks	       3960.0	  552967.7   1396.4
File Copy 256 bufsize 500 maxblocks	       1655.0	  160364.2    969.0	File Copy 256 bufsize 500 maxblocks	       1655.0	  169673.2   1025.2
File Copy 4096 bufsize 8000 maxblocks	       5800.0	 1205983.6   2079.3	File Copy 4096 bufsize 8000 maxblocks	       5800.0	 1250550.4   2156.1
Pipe Throughput				      12440.0	 2612652.8   2100.2	Pipe Throughput				      12440.0	 2568725.5   2064.9
Pipe-based Context Switching		       4000.0	  287447.5    718.6	Pipe-based Context Switching		       4000.0	  304515.1    761.3
Process Creation				126.0	    7145.8    567.1	Process Creation				126.0	    7288.7    578.5
Shell Scripts (1 concurrent)			 42.4	    6889.4   1624.9	Shell Scripts (1 concurrent)			 42.4	    7102.5   1675.1
Shell Scripts (8 concurrent)			  6.0	     892.5   1487.6	Shell Scripts (8 concurrent)			  6.0	     915.0   1525.0
System Call Overhead			      15000.0	 2264621.6   1509.7	System Call Overhead			      15000.0	 2316609.4   1544.4
								   ========									   ========
System Benchmarks Index Score					     1438.7	System Benchmarks Index Score					     1496.9
										```

@thypon
Copy link
Member Author

thypon commented Jan 19, 2021

I had a quick chat with tsys, the guy that mainlined that DTC definition and maintained the manjaro linux pinebook kernel. He told me that he was using the overclock on manjaro because he was sure the first batch was supporting higher clock. He is not sure any other batch supported that higher speed, so he mainlined a more conservative profile.

He added that it should not be possible to be sure of the correct profile if we don't ask directly to rockchip.

I'm now running the patched version since some days with heavy duty tasks + browsing, the W usage is very mild (6-8), even on battery. I don't believe it will be a dangerous mod.

While there is usually a correct profile, when the vendor step in, I don't believe my one is more or less dangerous at the moment, and, due to the fact that we run a OP1 profile until now I don't see how that will be an issue while we still use a distinct kernel for pinebook wrt generic arm64 builds.

@github-actions
Copy link

github-actions bot commented May 2, 2022

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label May 2, 2022
@github-actions github-actions bot closed this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants