Jump to content

Help needed: We want to improve performance on exotic boards


tkaiser

Recommended Posts

Dear all,

 

we need some help from Banana Pi M2 (not that important), Cubox-i/UDOO and ODROID XU4 users.

 

Please look through this Github issue and also have look how we currently handle IRQ redistribution on various board families (example 1 and example 2)

 

Since irqbalanced on ARM is broken (and if it would work it's often counterproductive) assigning IRQs statically to specific CPU cores increases overall system performance slightly for free. We do this for A20 boards for years (dual core --> sending Ethernet to second CPU core), extended this on H3 boards a few months ago (quad core and somewhat complicated due to the count of different boards exposing different interfaces) and added other board families just recently.

 

Now we need you!

 

In case you are somewhat experienced please get back to us with the output of

cat /proc/interrupts

(when you're running a more recent Armbian version then output of 'sudo armbianmonitor -u' is preferred!)

 

And in case you're able to do some testing please have a look at the examples above and the Github issue (Amlogic kernels seem to need different procfs calls for example), test yourself and provide code snippets already known to work!

 

Thx in advance!

Edited by wildcat_paris
minor typo (since=>for)
Link to comment
Share on other sites

XU4

 

 

gr@odroidxu4:~$ cat /etc/armbian.txt
--------------------------------------------------------------------------------



Title:                  Armbian 5.11 Odroidxu4 Ubuntu trusty default (unofficial)
Kernel:                 Linux 3.10.101
Build date:             14.05.2016
Author:                 Igor Pecovnik, www.igorpecovnik.com
Sources:                http://github.com/igorpecovnik

Support:                http://www.armbian.com


--------------------------------------------------------------------------------



gr@odroidxu4:~$ cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7
 65:          0          0          0          0          0          0          0          0       GIC  10800000.mdma
 66:          0          0          0          0          0          0          0          0       GIC  121a0000.pdma
 67:          0          0          0          0          0          0          0          0       GIC  121b0000.pdma
 77:          0          0          0          0          0          0          0          0       GIC  13400000.pinctrl
 78:          0          0          0          0          0          0          0          0       GIC  14000000.pinctrl
 82:          0          0          0          0          0          0          0          0       GIC  14010000.pinctrl
 85:         18          0          0          0          0          0          0          0       GIC  12c20000.serial
 88:          0          0          0          0          0          0          0          0       GIC  12c60000.i2c
 89:          0          0          0          0          0          0          0          0       GIC  12c70000.i2c
 92:          0          0          0          0          0          0          0          0       GIC  12ca0000.hsi2c
 93:          0          0          0          0          0          0          0          0       GIC  12cb0000.hsi2c
 97:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
101:          0          0          0          0          0          0          0          0       GIC  spi-s3c64xx
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:     553377          0          0          0          0          0          0          0       GIC  xhci-hcd:usb3
105:   54572268          0          0          0          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:   13670610          0          0          0          0          0          0          0       GIC  dw-mci
109:       4113          0          0          0          0          0          0          0       GIC  dw-mci
110:          0          0          0          0          0          0          0          0       GIC  13410000.pinctrl
126:          0          0          0          0          0          0          0          0       GIC  drm_mixer
128:          3          0          0          0          0          0          0          0       GIC  11000000.mfc
138:          0          0          0          0          0          0          0          0       GIC  12d10000.adc
142:          0          0          0          0          0          0          0          0       GIC  3880000.adma
146:          0          0          0          0          0          0          0          0       GIC  hdmi-cec
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
152:   42183713          0          0          0          0          0          0          0       GIC  mct_tick0
153:          0   23696180          0          0          0          0          0          0       GIC  mct_tick1
154:          0          0   23208468          0          0          0          0          0       GIC  mct_tick2
155:          0          0          0   22915935          0          0          0          0       GIC  mct_tick3
160:          0          0          0          0   56411289          0          0          0       GIC  mct_tick4
161:          0          0          0          0          0   32643942          0          0       GIC  mct_tick5
162:          0          0          0          0          0          0   38564153          0       GIC  mct_tick6
163:          0          0          0          0          0          0          0   33452062       GIC  mct_tick7
201:          0          0          0          0          0          0          0          0       GIC  11f20000.sysmmu
215:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
216:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
217:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
218:          0          0          0          0          0          0          0          0       GIC  12890000.sysmmu
220:          0          0          0          0          0          0          0          0       GIC  128a0000.sysmmu
247:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali
272:          0          0          0          0          0          0          0          0  COMBINER  13e80000.sysmmu
274:          0          0          0          0          0          0          0          0  COMBINER  13e90000.sysmmu
280:          0          0          0          0          0          0          0          0  COMBINER  14680000.sysmmu
282:          0          0          0          0          0          0          0          0  COMBINER  14640000.sysmmu
290:          0          0          0          0          0          0          0          0  COMBINER  11f10000.sysmmu
306:          0          0          0          0          0          0          0          0  COMBINER  11200000.sysmmu
316:          0          0          0          0          0          0          0          0  COMBINER  14650000.sysmmu
325:          0          0          0          0          0          0          0          0  COMBINER  11210000.sysmmu
404:          0          0          0          0          0          0          0          0  COMBINER  drm_fimd
414:          0          0          0          0          0          0          0          0  COMBINER  128e0000.sysmmu
434:          0          0          0          0          0          0          0          0  COMBINER  10a70000.sysmmu
436:          0          0          0          0          0          0          0          0  COMBINER  12880000.sysmmu
438:          0          0          0          0          0          0          0          0  COMBINER  128d0000.sysmmu
443:         13          0          0          0          0          0          0          0  COMBINER  mct_comp_irq
453:          0          0          0          0          0          0          0          0  COMBINER  10a60000.sysmmu
474:          0          0          0          0          0          0          0          0  COMBINER  128c0000.sysmmu
512:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  s2mps11
523:          0          0          0          0          0          0          0          0   s2mps11  rtc-alarm0
529:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  hdmi
530:          1          0          0          0          0          0          0          0  exynos_wkup_irq_chip  dwc3_id
531:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  dwc3_b_sess
533:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  gpio-keys: KEY_POWER
IPI0:          0          0          0          0          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0          0          0          0          0  Timer broadcast interrupts
IPI2:   24246515   23208640   20800956   20595844   23229974   23562283   21574939   21296430  Rescheduling interrupts
IPI3:         54         44         40         42         52         56         50         53  Function call interrupts
IPI4:          9         19          9         18        121         26        151         14  Single function call interrupts
IPI5:          0          0          0          0          0          0          0          0  CPU stop interrupts
IPI6:          0          0          0          0          0          0          0          0  CPU backtrace
Err:          0

 

 

sudo armbianmonitor -u is not very useful http://sprunge.us/WYTL

(note: I am managing XU4 fan PWM myself so it outputs a lots of logs)

Link to comment
Share on other sites

sudo armbianmonitor -u is not very useful http://sprunge.us/WYTL

 

Hmm... can you please replace the contents of /usr/local/bin/armbianmonitor with https://github.com/igorpecovnik/lib/blob/master/scripts/armbianmonitor/armbianmonitor then run the following code (and report back if error messages appear), generate some activity and try again?

echo 2 >/proc/irq/$(awk -F":" "/usb2/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 4 >/proc/irq/$(awk -F":" "/usb3/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 8 >/proc/irq/$(awk -F":" "/usb5/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 16 >/proc/irq/$(awk -F":" "/dw-mci/ {print \$1}" </proc/interrupts | sed 's/\ //g' | tail -1)/smp_affinity
echo 32 >/proc/irq/$(awk -F":" "/dw-mci/ {print \$1}" </proc/interrupts | sed 's/\ //g' | head -1)/smp_affinity
for i in $(awk -F':' '/11800000.mali/{print $1}' /proc/interrupts); do
	echo 64 >/proc/irq/$i/smp_affinity
done

(does the XU4 have no Ethernet? Or is this USB?!)

 

EDIT: It's Realtek 8153 USB3 chipset.

Link to comment
Share on other sites

 

 

           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
 65:          0          0          0          0          0          0          0          0       GIC  10800000.mdma
 66:          0          0          0          0          0          0          0          0       GIC  121a0000.pdma
 67:          0          0          0          0          0          0          0          0       GIC  121b0000.pdma
 74:          0          0          0          0          0          0          0          0       GIC  101d0000.watchdog
 77:          0          0          0          0          0          0          0          0       GIC  13400000.pinctrl
 78:          0          0          0          0          0          0          0          0       GIC  14000000.pinctrl
 82:          0          0          0          0          0          0          0          0       GIC  14010000.pinctrl
 85:         12          0          0          0          0          0          0          0       GIC  12c20000.serial
 88:          0          0          0          0          0          0          0          0       GIC  12c60000.i2c
 89:          0          0          0          0          0          0          0          0       GIC  12c70000.i2c
 92:          0          0          0          0          0          0          0          0       GIC  12ca0000.hsi2c
 93:          0          0          0          0          0          0          0          0       GIC  12cb0000.hsi2c
 97:         40          0          0          0          0          0          0          0       GIC  exynos_tmu
101:          0          0          0          0          0          0          0          0       GIC  spi-s3c64xx
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:       1372          0          0          0          0          0          0          0       GIC  xhci-hcd:usb3
105:   69096611          0          0          0          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:        200          0          0          0          0          0          0          0       GIC  dw-mci
109:   14610251          0          0          0          0          0          0          0       GIC  dw-mci
110:          0          0          0          0          0          0          0          0       GIC  13410000.pinctrl
126:          0          0          0          0          0          0          0          0       GIC  drm_mixer
128:          3          0          0          0          0          0          0          0       GIC  11000000.mfc
138:          0          0          0          0          0          0          0          0       GIC  12d10000.adc
142:          0          0          0          0          0          0          0          0       GIC  3880000.adma
146:          0          0          0          0          0          0          0          0       GIC  hdmi-cec
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
152:   92561831          0          0          0          0          0          0          0       GIC  mct_tick0
153:          0   20595317          0          0          0          0          0          0       GIC  mct_tick1
154:          0          0   16052076          0          0          0          0          0       GIC  mct_tick2
155:          0          0          0   14994396          0          0          0          0       GIC  mct_tick3
160:          0          0          0          0   18023649          0          0          0       GIC  mct_tick4
161:          0          0          0          0          0   24953244          0          0       GIC  mct_tick5
162:          0          0          0          0          0          0   16258537          0       GIC  mct_tick6
163:          0          0          0          0          0          0          0    8673074       GIC  mct_tick7
201:          0          0          0          0          0          0          0          0       GIC  11f20000.sysmmu
215:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
216:        263          0          0          0          0          0          0          0       GIC  exynos_tmu
217:        447          0          0          0          0          0          0          0       GIC  exynos_tmu
218:          0          0          0          0          0          0          0          0       GIC  12890000.sysmmu
220:          0          0          0          0          0          0          0          0       GIC  128a0000.sysmmu
247:          0          0          0          0          0          0          0          0       GIC  exynos_tmu
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali
272:          0          0          0          0          0          0          0          0  COMBINER  13e80000.sysmmu
274:          0          0          0          0          0          0          0          0  COMBINER  13e90000.sysmmu
280:          0          0          0          0          0          0          0          0  COMBINER  14680000.sysmmu
282:          0          0          0          0          0          0          0          0  COMBINER  14640000.sysmmu
290:          0          0          0          0          0          0          0          0  COMBINER  11f10000.sysmmu
306:          0          0          0          0          0          0          0          0  COMBINER  11200000.sysmmu
316:          0          0          0          0          0          0          0          0  COMBINER  14650000.sysmmu
325:          0          0          0          0          0          0          0          0  COMBINER  11210000.sysmmu
404:          0          0          0          0          0          0          0          0  COMBINER  drm_fimd
414:          0          0          0          0          0          0          0          0  COMBINER  128e0000.sysmmu
434:          0          0          0          0          0          0          0          0  COMBINER  10a70000.sysmmu
436:          0          0          0          0          0          0          0          0  COMBINER  12880000.sysmmu
438:          0          0          0          0          0          0          0          0  COMBINER  128d0000.sysmmu
443:         13          0          0          0          0          0          0          0  COMBINER  mct_comp_irq
453:          0          0          0          0          0          0          0          0  COMBINER  10a60000.sysmmu
474:          0          0          0          0          0          0          0          0  COMBINER  128c0000.sysmmu
512:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  s2mps11
523:          0          0          0          0          0          0          0          0   s2mps11  rtc-alarm0
529:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  hdmi
530:          1          0          0          0          0          0          0          0  exynos_wkup_irq_chip  dwc3_id
531:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  dwc3_b_sess
533:          0          0          0          0          0          0          0          0  exynos_wkup_irq_chip  gpio-keys: KEY_POWER
IPI0:          0          0          0          0          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0          0          0          0          0  Timer broadcast interrupts
IPI2:   17653799   19815007   18618701   17881865    9178030    8393902    5447400    6494852  Rescheduling interrupts
IPI3:        489        462        485        447        317        460        340        406  Function call interrupts
IPI4:         46         60         51         70         14         44         39         13  Single function call interrupts
IPI5:          0          0          0          0          0          0          0          0  CPU stop interrupts
IPI6:          0          0          0          0          0          0          0          0  CPU backtrace
Err:          0 

 

XU4, big heatsink, no fan :)

 

temp-xu4.png

 

 
http://sprunge.us/DDVC

Link to comment
Share on other sites

@Tk,

 

the issue with "armbianmonitor -u" when dmesg is too large you only get dmesg in the log

so I have rebooted & it is better

http://sprunge.us/jTFh

 

note: need to add activity

gr@odroidxu4:~$ sudo ./tkActivityTest
gr@odroidxu4:~$ sudo armbianmonitor -u
/var/log/armhwinfo.log has been uploaded to http://sprunge.us/hNgL

http://sprunge.us/hNgL

 

 

note: I have badly named your script : tkActivityTest => tkChangeIRQCPUaffinity

 

I have done HDD reading (cloudshell NAS uses USB3=>SATA), reading from /dev/TrueRNG (on USB3 port #2), find / for MMC

(no USB2, no Mali)

 

 

gr@odroidxu4:~$ sudo ./tkChangeIRQCPUaffinity
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:       1650          0        337          0          0          0          0          0       GIC  xhci-hcd:usb3
105:      23832          0          0      37163          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:      10775       3993          0          0          0          0          0          0       GIC  dw-mci
109:          0          0          0          0          0          0          0          0       GIC  dw-mci
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali
gr@odroidxu4:~$ ls /home2/gr/
kernel/                               SAV_odroid_image_20160518.bin         SAV_odroid_image_20160518.bin.SD.md5
save_2016_01/                         SAV_odroid_image_20160518.bin.md5
gr@odroidxu4:~$ cat /home2/gr/SAV_odroid_image_20160518.bin > /dev/null
gr@odroidxu4:~$ sudo ./tkChangeIRQCPUaffinity
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:       1650          0    1092375          0          0          0          0          0       GIC  xhci-hcd:usb3
105:      23832          0          0     210260          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:      10775      41906          0          0          0          0          0          0       GIC  dw-mci
109:          0          0          0          0          0          0          0          0       GIC  dw-mci
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali

 

 

 

to compare before reboot

 

 

gr@odroidxu4:~$ cat /proc/interrupts
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:     553377          0          0          0          0          0          0          0       GIC  xhci-hcd:usb3
105:   54572268          0          0          0          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:   13670610          0          0          0          0          0          0          0       GIC  dw-mci
109:       4113          0          0          0          0          0          0          0       GIC  dw-mci
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali

 

 

--

so my tkChangeIRQCPUaffinity script

 

 

 

gr@odroidxu4:~$ cat tkChangeIRQCPUaffinity
#!/bin/bash
echo 2 >/proc/irq/$(awk -F":" "/usb2/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 4 >/proc/irq/$(awk -F":" "/usb3/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 8 >/proc/irq/$(awk -F":" "/usb5/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 16 >/proc/irq/$(awk -F":" "/dw-mci/ {print \$1}" </proc/interrupts | sed 's/\ //g' | tail -1)/smp_affinity
echo 32 >/proc/irq/$(awk -F":" "/dw-mci/ {print \$1}" </proc/interrupts | sed 's/\ //g' | head -1)/smp_affinity
for i in $(awk -F':' '/11800000.mali/{print $1}' /proc/interrupts); do
        echo 64 >/proc/irq/$i/smp_affinity
done

cat /proc/interrupts | grep -E "usb|mci|mali"

 

 

Edited by wildcat_paris
"added" activity
Link to comment
Share on other sites

Would be great if you can replace the contents of /etc/init.d/armhwinfo with latest version from Github, then add the IRQ redirection stuff to the XU4 case construct, restart and report back after some activity.

 

And if you've some spare time maybe investigating what's wrong with the dmesg call in armbianmonitor's line 666 ;) -- maybe playing around with '-s, --buffer-size' option helps?

Link to comment
Share on other sites

Would be great if you can replace the contents of /etc/init.d/armhwinfo with latest version from Github, then add the IRQ redirection stuff to the XU4 case construct, restart and report back after some activity.

 

And if you've some spare time maybe investigating what's wrong with the dmesg call in armbianmonitor's line 666 ;) -- maybe playing around with '-s, --buffer-size' option helps?

 

part 1/

 

updated armhwinfo, added the IRQ redirection in /etc/rc.local and rebooted

 

 

 

gr@odroidxu4:~$ sudo ./tkChangeIRQCPUaffinity
[sudo] password for gr:
103:          1          0          0          0          0          0          0          0       GIC  ehci_hcd:usb1, ohci_hcd:usb2
104:       1419          0    1095945          0          0          0          0          0       GIC  xhci-hcd:usb3
105:       1547          0          0     319887          0          0          0          0       GIC  xhci-hcd:usb5
106:          0          0          0          0          0          0          0          0       GIC  11800000.mali
107:       9145      54306          0          0          0          0          0          0       GIC  dw-mci
109:          0          0          0          0          0          0          0          0       GIC  dw-mci
149:          1          0          0          0          0          0          0          0       GIC  11800000.mali
251:          0          0          0          0          0          0          0          0       GIC  11800000.mali

 

 

 

part 2/

 

Let's see what I can do with "dmesg"

 

I guess line 666 of armbianmonitor is not cursed

I had an old version of the script and I guess Igor too

 

up-to-date "armbianmonitor -u" is working

Edited by wildcat_paris
dmesg line 666 not cursed
Link to comment
Share on other sites

Banana Pi M2

PS: I don't use the latest Armbian toolchain. I'm using the .ignore_changes feature.

root@m2-bare:~# uname -a
Linux m2-bare 4.5.4-sunxi #2 SMP Sat Jun 11 13:05:21 CEST 2016 armv7l GNU/Linux
root@m2-bare:~# cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       
 17:          0          0          0          0     GIC-0  29 Edge      arch_timer
 18:      11870     265608      31223      36550     GIC-0  30 Edge      arch_timer
 21:          0          0          0          0     GIC-0  50 Level     sun4i_timer0
 22:          0          0          0          0     GIC-0  83 Level     sun5i_timer0
 27:          0          0          0          0     GIC-0  82 Level     1c02000.dma-controller
 28:       1653          0          0          0     GIC-0  92 Level     sunxi-mmc
 29:       8549          0          0          0     GIC-0  94 Level     sunxi-mmc
 30:         27          0          0          0     GIC-0 104 Level     ehci_hcd:usb1
 31:          0          0          0          0     GIC-0 105 Level     ohci_hcd:usb2
 40:       2251          0          0          0     GIC-0  60 Level     sun4i-ts
 41:        425          0          0          0     GIC-0  32 Level     serial
 42:      43646          0          0          0     GIC-0 114 Level     eth0
 48:          0          0          0          0     GIC-0  72 Level     1f00000.rtc
 57:          0          0          0          0  sunxi_pio_edge   4 Edge      1c0f000.mmc cd
181:         43          0          0          0  sunxi_pio_level   0 Level     brcmf_oob_intr
IPI0:          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:       3407      15690      13225       7318  Rescheduling interrupts
IPI3:          6          8          3          6  Function call interrupts
IPI4:          0          0          0          0  CPU stop interrupts
IPI5:          0          0          0          0  IRQ work interrupts
IPI6:          0          0          0          0  completion interrupts
Err:          0
root@m2-bare:~# 
Edited by Schwemmlandebene
Link to comment
Share on other sites

Banana Pi M2

PS: I don't use the latest Armbian toolchain.

 

Doesn't matter since it's just about testing out IRQ redistribution. Could you please exchange the contents of /etc/init.d/armhwinfo with this here, reboot and try again (doing some stuff and then checking/posting /proc/interrupts)? Or simply try to execute the statements in the BPi M2 case manually, do some stuff and get back with results (just to ensure that the code works and does something useful since it would be great if we could starting with 5.15 do reasonable IRQ distribution on every board we support). Thx!

Link to comment
Share on other sites

I did

- copy armhwinfo

- reboot

- copy some GB over NFS

root@m2-bare:~# cat /boot/.verbose 
1465726540 sun6i armv7l 4.5.4-sunxi   Linux version 4.5.4-sunxi (root@ubuarm) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #2 SMP Sat Jun 11 13:05:21 CEST 2016
root@m2-bare:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       
 17:          0          0          0          0     GIC-0  29 Edge      arch_timer
 18:      53622      41095     142718      94383     GIC-0  30 Edge      arch_timer
 21:          0          0          0          0     GIC-0  50 Level     sun4i_timer0
 22:          0          0          0          0     GIC-0  83 Level     sun5i_timer0
 27:          0          0          0          0     GIC-0  82 Level     1c02000.dma-controller
 28:       2095          0          0          0     GIC-0  92 Level     sunxi-mmc
 29:       8580          0          0          0     GIC-0  94 Level     sunxi-mmc
 30:         27          0          0          0     GIC-0 104 Level     ehci_hcd:usb1
 31:          0          0          0          0     GIC-0 105 Level     ohci_hcd:usb2
 40:        932          0          0          0     GIC-0  60 Level     sun4i-ts
 41:        423          0          0          0     GIC-0  32 Level     serial
 42:      30792     257702          0          0     GIC-0 114 Level     eth0
 48:          0          0          0          0     GIC-0  72 Level     1f00000.rtc
 57:          0          0          0          0  sunxi_pio_edge   4 Edge      1c0f000.mmc cd
181:         44          0          0          0  sunxi_pio_level   0 Level     brcmf_oob_intr
IPI0:          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:      43231      21388      45126      41832  Rescheduling interrupts
IPI3:          7          5          6          7  Function call interrupts
IPI4:          0          0          0          0  CPU stop interrupts
IPI5:          0          0          0          0  IRQ work interrupts
IPI6:          0          0          0          0  completion interrupts
Err:          0
root@m2-bare:~# 
Link to comment
Share on other sites

Thx, seems to work but unfortunately when testing locally I made a mistake that went on pastebin.com too:

		sun6i) # Banana Pi M2: do network on cpu1, SDIO on cpu2, USB on cpu3
			for i in $(awk -F':' '/eth0|brcmf_oob_intr/{print $1}' /proc/interrupts); do
				echo 2 >/proc/irq/$i/smp_affinity
			done
			for i in $(awk -F':' '/sunxi-mmc/{print $1}' lala.txt); do
				echo 4 >/proc/irq/$i/smp_affinity
			done
			for i in $(awk -F':' '/hcd:usb/{print $1}' lala.txt); do
				echo 8 >/proc/irq/$i/smp_affinity
			done
			;;

lala.txt should be replaced with /proc/interrupts then USB and SDIO IRQs should be handled by 3rd and 4th CPU core :)

Link to comment
Share on other sites

/proc/interrupts or </proc/interrupts?

if </proc/interrupts, what about line 232?

 

Doesn't really matter since awk either uses stdin or the file argument. Since it works (eth0 on cpu1) in your setup just with /proc/interrupts I would give this a try.

Link to comment
Share on other sites

Ahh, I didn't mind the awk syntax.

But bash complains.

root@m2-bare:/etc/init.d# /etc/init.d/armhwinfo start
[ ok ] Setting noop I/O scheduler for mmcblk0
[ ok ] Starting ARM hardware info:  (Linux version 4.5.4-sunxi (root@ubuarm) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #2 SMP Sat Jun 11 13:05:21 CEST 2016)
/etc/init.d/armhwinfo: line 233: echo: write error: Input/output error
                sun6i) # Banana Pi M2: do network on cpu1, SDIO on cpu2, USB on cpu3
                        for i in $(awk -F':' '/eth0|brcmf_oob_intr/{print $1}' /proc/interrupts); do
                                echo 2 >/proc/irq/$i/smp_affinity
                        done
                        for i in $(awk -F':' '/sunxi-mmc/{print $1}' /proc/interrupts); do
                                echo 4 >/proc/irq/$i/smp_affinity
                        done
                        for i in $(awk -F':' '/hcd:usb/{print $1}' /proc/interrupts); do
                                echo 8 >/proc/irq/$i/smp_affinity
                        done
                        ;;
Link to comment
Share on other sites

/etc/init.d/armhwinfo: line 233: echo: write error: Input/output error

 

Weird since eth0 has been sent successfully to cpu1 before? Can you please check state of /proc/interrupts now and maybe do the manual call again prefixing everything with

/bin/bash -x /etc/init.d/armhwinfo start

and upload the whole output on pastebin.com or similar? Thx!

Link to comment
Share on other sites

Hmm, I tried the lala version, too, and that's the output:

root@m2-bare:~# journalctl --no-pager | grep  armhwinfo
Jun 12 14:09:52 m2-bare armhwinfo[645]: [ ok ] Setting noop I/O scheduler for mmcblk0
Jun 12 14:09:52 m2-bare armhwinfo[645]: [ ok ] Starting ARM hardware info:  (Linux version 4.5.4-sunxi (root@ubuarm) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #2 SMP Sat Jun 11 13:05:21 CEST 2016)
Jun 12 14:09:52 m2-bare armhwinfo[645]: /etc/init.d/armhwinfo: line 233: echo: write error: Input/output error
Jun 12 14:09:52 m2-bare armhwinfo[645]: awk: cannot open lala.txt (No such file or directory)
Jun 12 14:09:52 m2-bare armhwinfo[645]: awk: cannot open lala.txt (No such file or directory)
root@m2-bare:~#
Link to comment
Share on other sites

I don't use postebin, etc. I could post the whole output here.

 

Here is a snippet:

+ ID='Banana Pi M2'
+ [[ Sinovoip BPI-M2 == *AMLOGIC* ]]
+ [[ Sinovoip BPI-M2 == *HummingBoard2* ]]
+ [[ -f /etc/armbian-release ]]
+ case ${HARDWARE} in
+ chmod 644 /etc/logrotate.d/armhwinfo
++ awk -F: '/eth0|brcmf_oob_intr/{print $1}' /proc/interrupts
+ for i in '$(awk -F'\'':'\'' '\''/eth0|brcmf_oob_intr/{print $1}'\'' /proc/interrupts)'
+ echo 2
+ for i in '$(awk -F'\'':'\'' '\''/eth0|brcmf_oob_intr/{print $1}'\'' /proc/interrupts)'
+ echo 2
/etc/init.d/armhwinfo: line 233: echo: write error: Input/output error
+ '[' -f /var/log/armhwinfo.log ']'
++ awk -F: '/sunxi-mmc/{print $1}' /proc/interrupts
++ date
+ for i in '$(awk -F'\'':'\'' '\''/sunxi-mmc/{print $1}'\'' /proc/interrupts)'
+ echo 4
+ for i in '$(awk -F'\'':'\'' '\''/sunxi-mmc/{print $1}'\'' /proc/interrupts)'
+ echo 4
+ echo -e '\n\n\nSun Jun 12 14:21:33 CEST 2016 sun6i armv7l 4.5.4-sunxi   Linux version 4.5.4-sunxi (root@ubuarm) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #2 SMP Sat Jun 11 13:05:21 CEST 2016'
++ awk -F: '/hcd:usb/{print $1}' /proc/interrupts
+ echo -e '\n### dmesg:\n'
+ cat /tmp/armhwinfo.OwXgVA
+ for i in '$(awk -F'\'':'\'' '\''/hcd:usb/{print $1}'\'' /proc/interrupts)'
+ echo 8
+ for i in '$(awk -F'\'':'\'' '\''/hcd:usb/{print $1}'\'' /proc/interrupts)'
+ echo 8
+ echo -e '\n### lsusb:'
+ '[' -f /boot/.verbose ']'

Does armhwinfo do not exit?


root@m2-bare:~# cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       
 17:          0          0          0          0     GIC-0  29 Edge      arch_timer
 18:       3795       8165      75263       8169     GIC-0  30 Edge      arch_timer
 21:          0          0          0          0     GIC-0  50 Level     sun4i_timer0
 22:          0          0          0          0     GIC-0  83 Level     sun5i_timer0
 27:          0          0          0          0     GIC-0  82 Level     1c02000.dma-controller
 28:        625          0       1910          0     GIC-0  92 Level     sunxi-mmc
 29:       8266          0          0          0     GIC-0  94 Level     sunxi-mmc
 30:         27          0          0        262     GIC-0 104 Level     ehci_hcd:usb1
 31:          0          0          0          0     GIC-0 105 Level     ohci_hcd:usb2
 40:        498          0          0          0     GIC-0  60 Level     sun4i-ts
 41:        430          0          0          0     GIC-0  32 Level     serial
 42:      31217      10822          0          0     GIC-0 114 Level     eth0
 48:          0          0          0          0     GIC-0  72 Level     1f00000.rtc
 57:          0          0          0          0  sunxi_pio_edge   4 Edge      1c0f000.mmc cd
181:         44          0          0          0  sunxi_pio_level   0 Level     brcmf_oob_intr
IPI0:          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:       4199       8013      14879       8066  Rescheduling interrupts
IPI3:          9          9          6          4  Function call interrupts
IPI4:          0          0          0          0  CPU stop interrupts
IPI5:          0          0          0          0  IRQ work interrupts
IPI6:          0          0          0          0  completion interrupts
Err:          0
root@m2-bare:~# 

Link to comment
Share on other sites

Hmm... since the code does what it's supposed to (sending IRQ processing to dedicated CPU cores) I'll simply suffix all the calls with ' 2>/dev/null'. Thx for your help, new settings will then be active starting with Armbian 5.15 :)

Link to comment
Share on other sites

Are you sure?

root@m2-bare:~# cat /proc/irq/181/smp_affinity
f
root@m2-bare:~# cat /proc/irq/42/smp_affinity
2
root@m2-bare:~# cat /proc/irq/31/smp_affinity
8
root@m2-bare:~# cat /proc/irq/30/smp_affinity
8
root@m2-bare:~# cat /proc/irq/29/smp_affinity
4
root@m2-bare:~# cat /proc/irq/28/smp_affinity
4
root@m2-bare:~# echo 2 > /proc/irq/181/smp_affinity
-bash: echo: write error: Input/output error
root@m2-bare:~# 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines