Basic mainline linux support

Post Reply
elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Basic mainline linux support

Post by elatllat » Sun May 03, 2020 11:13 am

I see the dts was sent in nice and quick;
https://patchwork.kernel.org/cover/11507767/


The compile time is a lot slower than the N2;

N2: real 16m44.692s # kernel 5.4
C4: real 52m13.048s # kernel 5.7

Granted different kernel and compiler versions but it still seems a bit off.
(I'm aware of the overclock option but don't want to melt it just yet)

User avatar
tobetter
Posts: 5070
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 159 times
Been thanked: 483 times
Contact:

Re: Basic mainline linux support

Post by tobetter » Sun May 03, 2020 12:01 pm

Do you see the difference in the compile-time if Linux 5.4 runs on ODROID-C4?

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Sun May 03, 2020 2:13 pm

About the same compiling 5.4 from 4.9;
C4: real 47m9.163s # kernel 5.4
Last edited by elatllat on Sun May 03, 2020 2:38 pm, edited 1 time in total.

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Sun May 03, 2020 2:31 pm

I wonder if the severe hit in performance has something to do with the fact the C4 doesn't support OOoE (out-of-order-execution)?

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Mon May 04, 2020 7:28 am

I'd expect that to show in the other benchmarks though.
I'll time building 5.4 from 5.4 once I sort out the IO problem I'm experiencing.

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Mon May 04, 2020 11:27 am

Compiling the kernel is a lot different than a synthetic benchmark as you know.
These users thanked the author rooted for the post:
Mullcom (Mon May 04, 2020 3:40 pm)

User avatar
Mullcom
Posts: 183
Joined: Sun Jun 30, 2019 1:41 am
languages_spoken: english
Has thanked: 97 times
Been thanked: 17 times
Contact:

Re: Basic mainline linux support

Post by Mullcom » Mon May 04, 2020 3:43 pm

rooted wrote:
Mon May 04, 2020 11:27 am
Compiling the kernel is a lot different than a synthetic benchmark as you know.
Hello Rooted.

I am in work to learn about compiling kernal. I have seen it can be nice to have skills. Maybe you can help me with some information, sites guides dokuments tutorials?

User avatar
mad_ady
Posts: 7890
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 490 times
Been thanked: 348 times
Contact:

Re: Basic mainline linux support

Post by mad_ady » Mon May 04, 2020 4:08 pm

I'm using this guide, though it's not yet updated for c4: https://github.com/umiddelb/armhf/wiki/ ... ARM-device
These users thanked the author mad_ady for the post:
Mullcom (Mon May 04, 2020 5:06 pm)

User avatar
Mullcom
Posts: 183
Joined: Sun Jun 30, 2019 1:41 am
languages_spoken: english
Has thanked: 97 times
Been thanked: 17 times
Contact:

Re: Basic mainline linux support

Post by Mullcom » Mon May 04, 2020 5:10 pm

mad_ady wrote:I'm using this guide, though it's not yet updated for c4: https://github.com/umiddelb/armhf/wiki/ ... ARM-device
Thx. One thing I am wondering. What are you need for doing this. Are you compiling on the unit itself or do you compile on a separate unit and then test it on the unit you want use it on?

How dose the setup look like?

What do you have to do before on the system you compile?

Skickat från min SM-G973F via Tapatalk


User avatar
mad_ady
Posts: 7890
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 490 times
Been thanked: 348 times
Contact:

Re: Basic mainline linux support

Post by mad_ady » Mon May 04, 2020 5:47 pm

I usually compile on the device itself. Most odroids are powerful enough for native compiling

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Mon May 04, 2020 6:27 pm

@elatllat Try compiling the same kernel and config on the C2, it should be quite a bit slower but if it's not it shows the issue is likely compiler related.

I'm going to do some experimentation on the C4 and see if I come up with anything.

User avatar
joerg
Posts: 1027
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 32 times
Been thanked: 71 times
Contact:

Re: Basic mainline linux support

Post by joerg » Mon May 04, 2020 6:38 pm

Yes, powerful enough. But if you are as impatience as I am, you like to do it on the host machine:
real 3m18,438s. ;)
Please forgive, it's off topic.
These users thanked the author joerg for the post:
Mullcom (Tue May 05, 2020 4:06 am)

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Mon May 04, 2020 11:27 pm

Well I got a nice Manjaro dev to build a minimal image for the C4, installed devtools, pulled Hardkernel C4 source down, found no "odroidc4_defconfig" so I fixed it and created a pull request.

Started building the kernel but it had "-Werror" enabled in Kbuild flags which was of course causing the build to fail, fixed that and this is what I got.

The C4 temperature never exceeded 59.0°C with four threads going in a 25°C ambient room, the highest memory usage I saw was only 381 megabyte. Something is wrong with both of these numbers and points to something strange afoot.

Error out on:

Code: Select all

drivers/net/wireless/rtl8812au/core/rtw_ap.c: In function ‘rtw_add_bcn_ie’:
drivers/net/wireless/rtl8812au/core/rtw_ap.c:216:24: error: ‘ielen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Time:

Code: Select all

real    70m48.053s
user    259m27.836s
sys     20m59.621s
GCC:

Code: Select all

gcc version 9.3.0 (GCC)
Kernel on C4

Code: Select all

Linux odroidc4 5.7.0-rc3-4-MANJARO-ARM
I could fix the error but I'm tired and don't want to currently, maybe later after I sleep I will retry and get the full time.

But the device should have gotten hotter and it should have used more RAM.

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Tue May 05, 2020 12:04 am

rooted wrote:
Mon May 04, 2020 11:27 pm
...
drivers/net/wireless...
I use

Code: Select all

CONFIG_WIRELESS=n
CONFIG_WLAN=n
while changing other defaults.

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Tue May 05, 2020 12:21 am

That explains your shorter compile time, wireless takes a long time to compile.

I will add your patch and change the config to match yours so the times will be relevant.

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Tue May 05, 2020 12:30 am

rooted wrote:
Mon May 04, 2020 6:27 pm
@elatllat Try compiling the same kernel and config on the C2...
I don't have one, but maybe someone else can do that comparison.

back2future
Posts: 292
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 13 times
Been thanked: 8 times
Contact:

Re: Basic mainline linux support

Post by back2future » Tue May 05, 2020 1:48 am


Time:

Code: Select all

real    70m48.053s
user    259m27.836s
sys     20m59.621s
~112min for arm64 defconfig ( not odroidc4_defconfig ) with -j3 for 5.4.0 kernel source and compiling kernel (Image, Image.gz), dtbs and modules

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Tue May 05, 2020 6:12 am

Using my slightly optimized from default config;

Code: Select all

N2: real 16m 44.692s # kernel 5.4  from 5.4
C4: real 52m 13.048s # kernel 5.7  from 4.9
C4: real 47m  9.163s # kernel 5.4  from 4.9
C4: real 54m 47.641s # kernel 5.7  from 5.7
So yes HK might want to post a benchmark reflecting that
just to inform users that the N2 is faster if one prefers speed over in order execution.
Anyway time for other kernel fun.

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Tue May 05, 2020 8:06 pm

back2future wrote:

Time:

Code: Select all

real    70m48.053s
user    259m27.836s
sys     20m59.621s
~112min for arm64 defconfig ( not odroidc4_defconfig ) with -j3 for 5.4.0 kernel source and compiling kernel (Image, Image.gz), dtbs and modules
That on a C2?

User avatar
mad_ady
Posts: 7890
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 490 times
Been thanked: 348 times
Contact:

Re: Basic mainline linux support

Post by mad_ady » Wed May 06, 2020 4:00 am

Could the slow compile time be related to this misconfiguration? https://r.tapatalk.com/shareLink/topic? ... source=app

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Wed May 06, 2020 5:07 am

mad_ady wrote:
Wed May 06, 2020 4:00 am
Could the slow compile time be related to this misconfiguration? https://r.tapatalk.com/shareLink/topic? ... source=app
Your link is no good, what are you referring to?

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Wed May 06, 2020 5:36 am

rooted wrote:
Wed May 06, 2020 5:07 am
mad_ady wrote:
Wed May 06, 2020 4:00 am
Could the slow compile time be related to this misconfiguration? https://r.tapatalk.com/shareLink/topic? ... source=app
Your link is no good, what are you referring to?
de-tapatalk-spam-ified;
viewtopic.php?f=202&t=38725&p=291357#p291357
These users thanked the author elatllat for the post:
rooted (Wed May 06, 2020 5:45 am)

User avatar
mad_ady
Posts: 7890
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 490 times
Been thanked: 348 times
Contact:

Re: Basic mainline linux support

Post by mad_ady » Wed May 06, 2020 2:49 pm

<offtopic>Sorry about that. Back in the day there was a xposed module that did that automatically for talpatalk urls. Not sure I can use anything now...

back2future
Posts: 292
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english
Has thanked: 13 times
Been thanked: 8 times
Contact:

Re: Basic mainline linux support

Post by back2future » Wed May 06, 2020 5:28 pm


Time:

Code: Select all

real    70m48.053s
user    259m27.836s
sys     20m59.621s
~112min for arm64 defconfig ( not odroidc4_defconfig ) with -j3 for 5.4.0 kernel source and compiling kernel (Image, Image.gz), dtbs and modules
That on a C2?
Didn't want to stress hardware so it only was 3 threads (compares to 3 cores, if threads -j3 are not "blocked" while a sub-make is waiting for disk data or other compiling thread being done before), 1.9Ghz inside docker and maybe also some additional module compiling compared to (later) default defconfig and had some additional system monitoring running, what probably altogether sums up into this time difference (so it can be seen like confirming Your results, 3/4*1.908/2.016*112min~79min).

[ not sure if it fits inside this thread for C4, but change from 'bigLittle' -> 'DynamIQ' could affect Kernel related configuration (and compile times) and binaries performance? Found another 3:18mins :ugeek:
verified: GNU Make 4.2.1 ]
Last edited by back2future on Wed May 06, 2020 9:15 pm, edited 3 times in total.
These users thanked the author back2future for the post:
rooted (Wed May 06, 2020 5:59 pm)

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Wed May 06, 2020 5:59 pm

I just wasn't sure since I mentioned the C2, my compilation wasn't fully finished and had about 5 minutes left after it failed. So your time is spot on.

elatllat
Posts: 1740
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4
Has thanked: 44 times
Been thanked: 109 times
Contact:

Re: Basic mainline linux support

Post by elatllat » Wed May 06, 2020 7:03 pm

mad_ady wrote:
Wed May 06, 2020 2:49 pm
<offtopic>Sorry about that. Back in the day there was a xposed module that did that automatically for talpatalk urls. Not sure I can use anything now...
https://xkcd.com/1367/
These users thanked the author elatllat for the post:
mad_ady (Wed May 06, 2020 8:06 pm)

fvolk
Posts: 372
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 21 times
Contact:

Re: Basic mainline linux support

Post by fvolk » Sun May 17, 2020 12:20 am

I'm considering to buy C4s :-)
Can anyone comment on the current state of the upstream kernel?
I only need headless server use, but the basics should work - microSD, USB, etc.

User avatar
rooted
Posts: 7595
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 656 times
Been thanked: 173 times
Contact:

Re: Basic mainline linux support

Post by rooted » Sun May 17, 2020 1:48 am

fvolk wrote:I'm considering to buy C4s :-)
Can anyone comment on the current state of the upstream kernel?
I only need headless server use, but the basics should work - microSD, USB, etc.
5.7 works fine

fvolk
Posts: 372
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 21 times
Contact:

Re: Basic mainline linux support

Post by fvolk » Sun May 17, 2020 2:29 am

I wonder, is it possible to share an upstream kernel image (and u-boot on microSD) for C4 and C2, given that they are related chips?
(I cannot think of a reason why userspace needs to be different for headless use?)

User avatar
tobetter
Posts: 5070
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 159 times
Been thanked: 483 times
Contact:

Re: Basic mainline linux support

Post by tobetter » Sun May 17, 2020 2:45 am

fvolk wrote:
Sun May 17, 2020 2:29 am
I wonder, is it possible to share an upstream kernel image (and u-boot on microSD) for C4 and C2, given that they are related chips?
(I cannot think of a reason why userspace needs to be different for headless use?)
The biggest piece that blocks sharing a single OS image between two board ODROID-C2/C4/N2 is U-boot. The mainline kernel tree has the supports ODROID-C4 and ODROID-C2, technically the mainline kernel can be shared and can boot if the decent device tree can be loaded on boot. There could be a couple of ways to boot the single OS image on ODROID-C2/C4 but still needs to tweak the image.

fvolk
Posts: 372
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 21 times
Contact:

Re: Basic mainline linux support

Post by fvolk » Sun May 17, 2020 3:09 am

So in theory only the device tree dtb file needs to be different?
Well, if uboot.scr could detect whether it is running on C2 or C4 and pass a different dtb to the kernel.... hmm.
I'll order some C4s now, I have to wait anyway until they are here... :-)

User avatar
mad_ady
Posts: 7890
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 490 times
Been thanked: 348 times
Contact:

Re: Basic mainline linux support

Post by mad_ady » Sun May 17, 2020 2:23 pm

Doesn't u-boot use a dtb of its own as well?
Or is it just compiled for a specific target only?

fvolk
Posts: 372
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 21 times
Contact:

Re: Basic mainline linux support

Post by fvolk » Sun May 17, 2020 11:02 pm

Hmm... good point.
But looking at the Wiki https://wiki.odroid.com/odroid-c4/softw ... ing_u-boot
Odroid seems to patch an ancient v2015.01 uboot for the brand new C4, using an even older GCC?
I'm confused :-/

User avatar
tobetter
Posts: 5070
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 159 times
Been thanked: 483 times
Contact:

Re: Basic mainline linux support

Post by tobetter » Sun May 17, 2020 11:45 pm

mad_ady wrote:
Sun May 17, 2020 2:23 pm
Doesn't u-boot use a dtb of its own as well?
Or is it just compiled for a specific target only?
U-boot does not use its own DTB and even we say "U-boot" it's not purely Das U-boot from Denx Software Engineering. There is another bootstrap code before start U-boot, BL1->BL2->BL3, they are fetched by SoC itself one after another and they are not compatible between SoC at all.

This is the directory that contains such bootstrap for ODROID-C4 (g12a) and ODROID-C4 (g12b).
https://github.com/hardkernel/u-boot/tr ... 015.01/fip

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests