OrangePiLibra / OrangePi_H5SDK

The Liunx SDK of OrangePi for Allwinner H5
47 stars 24 forks source link

Backport getrandom #3

Open ThomasKaiser opened 7 years ago

ThomasKaiser commented 7 years ago

In case it hasn't already happen may I suggest backporting getrandom system call? Fixes things with more recent systemd versions (I'm running Armbian/Xenial on my OPi PC 2): https://github.com/longsleep/linux-pine64/commits/backport_getrandom

BuddyZhang1 commented 7 years ago

@ThomasKaiser Thanks for your suggest, I will merge this system call, and when I running Xenial/ArchLinux on OrangePi PC2, always dump some stack information from systemd, I can't finger out what is going on.

System time before build time, advancing clock. [ 9.203054] systemd[1]: syscall 278 [ 9.206949] Code: aa0503e4 aa0603e5 aa0703e6 d4000001 (b13ffc1f) [ 9.213622] CPU: 0 PID: 1 Comm: systemd Not tainted 3.10.65 #31 [ 9.220113] task: ffffffc03d8ecb00 ti: ffffffc03d8f0000 task.ti: ffffffc03d8f0000 [ 9.228347] PC is at 0x7f7cde03e4 [ 9.231971] LR is at 0x7f7d01920c [ 9.235606] pc : [<0000007f7cde03e4>] lr : [<0000007f7d01920c>] pstate: 80000000 [ 9.243700] sp : 0000007ff149ca50 [ 9.247413] x29: 0000007ff149ca50 x28: 00000055909e6000 [ 9.253234] x27: 0000000000000000 x26: 0000000000000000 [ 9.259068] x25: 0000007ff149cbd8 x24: 0000000000000000 [ 9.264901] x23: 0000007f7d17fbf0 x22: 0000007f7d17f000 [ 9.270724] x21: 0000000000000001 x20: 0000000000000010 [ 9.276553] x19: 0000007f7d17fbf0 x18: 0000000000000000 [ 9.282371] x17: 0000007f7cde03c0 x16: 0000007f7d17d420 [ 9.288204] x15: 0000007f7cffec5c x14: 0000000000000001 [ 9.294036] x13: 00642e666e6f632e x12: 6d65747379732f64 [ 9.299855] x11: 0000000000000035 x10: 0101010101010101 [ 9.305687] x9 : 6f632e6d65747379 x8 : 0000000000000116 [ 9.311505] x7 : 0000000000001010 x6 : 0000000000001010 [ 9.317333] x5 : 61686b2e7172742e x4 : 0000000000001011 [ 9.323151] x3 : 00000055909e82da x2 : 0000000000000001 [ 9.328982] x1 : 0000000000000010 x0 : 0000007f7d17fbf0 [ 9.334809] [ 9.346602] systemd[1]: systemd 231 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) [ 9.367357] systemd[1]: Detected architecture arm64.

Welcome to Arch Linux ARM!

ThomasKaiser commented 7 years ago

This should solve exactly that :)

BuddyZhang1 commented 7 years ago

@ThomasKaiser You are right :+1:

ThomasKaiser commented 7 years ago

Great to hear that. On a related note: May I introduce linux-sunxi community: http://linux-sunxi.org/Main_Page

Regarding kernel: Most if not all of these patches here for A64 should apply cleanly to H5 BSP kernel (checked myself only the stuff to get kernel version up to 3.10.100 since this fixes tons of security and other bugs. And I used a different BSP kernel drop IIRC: the 3.10.65 release for Banana Pi M2 Ultra). It would be great to try to apply them if you find some time (not highest priority atm though, better try to get hardware support as good as possible now :) )

And since I don't know whether you already included improved version of camera driver just as a hint: https://github.com/avafinger/gc2035

ThomasKaiser commented 7 years ago

Regarding Gigabit Ethernet performance. As already reported I test through different TX/RX delay settings. Now against another host I get at least variations regarding retransmit counts:

TX/RX   TX      RX  
delay:  Mb/s    retry   Mb/s    retry
 0/ 0:  547 0   942 0
 0/ 1:  549.4   0   939 65
 0/ 2:  557.4   0   940 88
 0/ 3:  543.2   0   932 159
 0/ 4:  556.4   229 942 0
 0/ 5:  551 0   941 67
 0/ 6:  556 0   941 0
 0/ 7:  551 0   940 61
 0/ 8:  553.8   0   940 0
 0/ 9:  551 0   941 0
 0/10:  556.8   181 940 211
 0/11:  553 0   942 0
 0/12:  557.2   0   938 193
 0/13:  550 0   941 3
 0/14:  554 0   941 44
 0/15:  555 0   939 12
 0/16:  556.2   0   941 43
 0/17:  559.4   0   940 88
 0/18:  558 0   941 65
 0/19:  547 0   941 90
 0/20:  550 0   940 179
 0/21:  557 0   941 87
 0/22:  555.9   0   939 116
 0/23:  556 0   942 0
 0/24:  555.9   0   941 92
 0/25:  555 0   940 68
 0/26:  550 0   942 0
 0/27:  553.4   0   941 33
 0/28:  552 0   939 44
 0/29:  552.2   0   940 14
 0/30:  556.2   0   942 0
 0/31:  552 0   940 31
 1/ 0:  555.5   0   940 36
 1/ 1:  554.7   0   941 9
 1/ 2:  553 0   940 98
 1/ 3:  553 0   940 185
 1/ 4:  547.3   0   940 0
 1/ 5:  547 0   940 0
 1/ 6:  555 0   939 87
 1/ 7:  552.7   0   938 92
 1/ 8:  553.2   0   940 37
 1/ 9:  551 10  940 40
 1/10:  553.9   0   942 0
 1/11:  554.3   0   938 48
 1/12:  551 0   942 0
 1/13:  556.4   0   941 35
 1/14:  553 0   938 35
 1/15:  548.4   0   942 0
 1/16:  552.8   0   941 24
 1/17:  554.1   0   941 62
 1/18:  549 0   940 208
 1/19:  555 0   941 44
 1/20:  554 0   941 54
 1/21:  553.3   1   942 88
 1/22:  558 0   941 135
 1/23:  552.1   0   942 0
 1/24:  547.2   0   941 17
 1/25:  546.2   0   942 0
 1/26:  549.2   167 938 53
 1/27:  550 0   939 63
 1/28:  553 0   942 0
 1/29:  552.5   0   938 41
 1/30:  552.7   0   942 0
 1/31:  555.6   0   941 23
 2/ 0:  551.7   0   940 17
 2/ 1:  550 0   939 32
 2/ 2:  552 0   941 116
 2/ 3:  559.7   0   941 52
 2/ 4:  548 0   942 41
 2/ 5:  553 0   939 45
 2/ 6:  550 0   935 55
 2/ 7:  557 0   941 14
 2/ 8:  550.5   0   941 0
 2/ 9:  553 0   940 80
 2/10:  548.6   0   940 176

But I think there's something wrong in the kernel since with A64/Pine64 we're able to exceed 900 Mbits/sec in both directions without extensive tuning. I will let this test run now and update results later but think applying the A64 kernel patches to H5 BSP source should happen first. Comparing kernel config is also worth a look of course :)

BuddyZhang1 commented 7 years ago

@ThomasKaiser Thanks for your suggest! I have add 2 patchs about:

  1. simplify loop in random_read
  2. random: introduce getrandom(2) system call
BuddyZhang1 commented 7 years ago

@ThomasKaiser About Gigabit Ethernet performance, I will open a new issue and discuss on there.