Welcome, Guest

Author Topic: loadavg always >=1.00 on debian  (Read 7960 times)

hnb2907

  • Newbie
  • *
  • Posts: 27
  • Karma: +2/-0
loadavg always >=1.00 on debian
« on: August 21, 2013, 11:48:36 PM »
Hi all,

I'm running the revision 2 debian image from here https://www.olimex.com/wiki/A20-OLinuXino-MICRO.  The loadavg never drops below 1.00, and will sit at exactly "load average: 1.00, 1.00, 1.00" if the system is idling for many hours.  The CPU's are normally ~99% idle.

Is it similar to this issue seen here: http://ict-crew.nl/qube:high_load_average_fix  How to fix for debian on the A20?

For reference, some results from my A20 board:
Code: [Select]
root@A20:~# uptime
 21:28:14 up 35 min,  2 users,  load average: 1.00, 1.01, 0.93
root@A20:~#
Code: [Select]
top - 21:42:26 up 49 min,  2 users,  load average: 1.00, 1.01, 0.97
Tasks:  73 total,   1 running,  72 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.1 us,  0.8 sy,  0.0 ni, 99.0 id,  0.1 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:    998524 total,   129656 used,   868868 free,    34128 buffers
KiB Swap:        0 total,        0 used,        0 free,    62876 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
    3 root      20   0     0    0    0 S   2.4  0.0   1:16.28 [ksoftirqd/0]
    9 root      20   0     0    0    0 S   2.3  0.0   1:00.06 [ksoftirqd/1]
 3777 root      20   0  4068 1188  896 R   0.3  0.1   0:00.07 top -b -n 2 -d 10 -c
  711 root      20   0     0    0    0 S   0.2  0.0   0:03.25 [hdmi proc]
 3774 root      20   0     0    0    0 S   0.2  0.0   0:00.06 [kworker/0:0]
  481 root      20   0     0    0    0 S   0.1  0.0   0:02.89 [kworker/1:1]
    1 root      20   0  1684  624  520 S   0.0  0.1   0:03.60 init [2]
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [kthreadd]
    6 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 [migration/0]
    7 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 [migration/1]
   10 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [khelper]
   11 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [kdevtmpfs]
   12 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [netns]
   13 root      20   0     0    0    0 S   0.0  0.0   0:00.11 [kworker/u:1]
   16 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [sync_system_wor]
   21 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [earlysuspend_ho]
  236 root      20   0     0    0    0 S   0.0  0.0   0:00.01 [sync_supers]
  238 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [bdi-default]
  240 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [kblockd]
  259 root      20   0     0    0    0 S   0.0  0.0   0:00.06 [khubd]
  264 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [cpufreq_uevent]
  307 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [cfg80211]
  308 root      20   0     0    0    0 S   0.0  0.0   0:00.13 [kworker/0:1]
  396 root      20   0     0    0    0 D   0.0  0.0   0:00.21 [usb-hardware-sc]
  403 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [rpciod]
  407 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [kswapd0]
  408 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [fsnotify_mark]
  409 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [nfsiod]
  413 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [crypto]
  462 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [khvcd]
  517 root      20   0     0    0    0 S   0.0  0.0   0:00.01 [scsi_eh_0]
  520 root      20   0     0    0    0 S   0.0  0.0   0:00.12 [kworker/u:2]
  566 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [scsi_eh_1]
  567 root      20   0     0    0    0 S   0.0  0.0   0:00.02 [usb-storage]
  582 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [f_mtp]
  587 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [file-storage]
  616 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [kworker/1:2]
  635 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [fantasys]
  720 root      20   0     0    0    0 S   0.0  0.0   0:02.95 [mmcqd/0]
  728 root      20   0     0    0    0 S   0.0  0.0   0:00.05 [flush-179:0]
  729 root      20   0     0    0    0 S   0.0  0.0   0:00.06 [jbd2/mmcblk0p2-]
  730 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [ext4-dio-unwrit]
  843 root      20   0  2484 1248  624 S   0.0  0.1   0:00.46 udevd --daemon
  944 root      20   0  2480 1072  432 S   0.0  0.1   0:00.04 udevd --daemon
  945 root      20   0  2480 1016  388 S   0.0  0.1   0:00.00 udevd --daemon
 2253 root      20   0  4104 1960  248 S   0.0  0.2   0:00.00 dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
 2288 root      20   0     0    0    0 S   0.0  0.0   0:00.14 [cifsd]
 2400 root      20   0  1892  744  528 S   0.0  0.1   0:00.02 /sbin/rpcbind -w
 2431 statd     20   0  2204 1084  676 S   0.0  0.1   0:00.01 /sbin/rpc.statd
 2443 root      20   0  7068  832  332 S   0.0  0.1   0:00.00 /usr/sbin/rpc.idmapd
 2674 lp        20   0  1652  472  348 S   0.0  0.0   0:00.00 /usr/sbin/lpd -s
 2688 daemon    20   0  1720  300  172 S   0.0  0.0   0:00.00 /usr/sbin/atd
 2868 messageb  20   0  2584  892  612 S   0.0  0.1   0:00.03 /usr/bin/dbus-daemon --system
 2907 root      20   0  3352  692  532 S   0.0  0.1   0:00.01 /usr/sbin/cron
 3116 root      20   0  8148 1424  960 S   0.0  0.1   0:00.15 /usr/sbin/nmbd -D
 3169 root      20   0  5188  960  540 S   0.0  0.1   0:00.00 /usr/sbin/sshd
 3187 root      20   0 15572 2748 2076 S   0.0  0.3   0:00.10 /usr/sbin/smbd -D
 3212 root      20   0 16088 1092  420 S   0.0  0.1   0:00.00 /usr/sbin/smbd -D
 3225 root      20   0 12228 1964 1420 S   0.0  0.2   0:00.03 /usr/sbin/winbindd
 3244 root      20   0 12228 1232  684 S   0.0  0.1   0:00.01 /usr/sbin/winbindd
 3245 Debian-e  20   0  9416 1108  524 S   0.0  0.1   0:00.00 /usr/sbin/exim4 -bd -q30m
 3292 minidlna  20   0 36700 3692 1124 S   0.0  0.4   0:00.49 /usr/bin/minidlna -f /etc/minidlna.conf -P /run/minidlna/minidlna.pid
 3293 root      20   0  3340  708  580 S   0.0  0.1   0:00.01 /sbin/getty 38400 tty1
 3294 root      20   0  3340  708  580 S   0.0  0.1   0:00.01 /sbin/getty 38400 tty2
 3295 root      20   0  3632 1568 1128 S   0.0  0.2   0:00.06 /bin/login -f
 3298 root      20   0 27468 3256 2160 S   0.0  0.3   0:00.16 /usr/sbin/console-kit-daemon --no-daemon
 3365 root      20   0 22196 2516 2028 S   0.0  0.3   0:00.09 /usr/lib/policykit-1/polkitd --no-debug
 3374 root      20   0  5272 2744 1248 S   0.0  0.3   0:00.31 -bash
 3393 root      20   0 11884 3560 2680 S   0.0  0.4   0:00.97 sshd: root@pts/1
 3398 root      20   0  5300 2864 1332 S   0.0  0.3   0:01.45 -bash
 3626 root      20   0     0    0    0 S   0.0  0.0   0:00.00 [jbd2/sda2-8]
 3627 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 [ext4-dio-unwrit]
 3700 root      20   0     0    0    0 S   0.0  0.0   0:02.59 [kworker/0:2]


Many thanks,
Chris.
« Last Edit: August 21, 2013, 11:50:09 PM by hnb2907 »

PaceyIV

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #1 on: August 22, 2013, 03:22:25 PM »
You're right.

I upload at link https://drive.google.com/folderview?id=0BzF5qrRdBNDbR0ZCdkJ3LWJCWEE&usp=sharing the script.bin modified. You can save this to the boot partition on the microSD.

I do this:

XFer

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #2 on: August 23, 2013, 06:44:04 PM »
Note: with this "fix", on my board the OTG USB port does not work anymore.

Reverting this "fix", it works again.

Fernando

PaceyIV

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #3 on: August 23, 2013, 09:33:32 PM »
I haven't tried to use the UBS port.
I use the board as a server, so it's not a things to worry about.

XFer

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #4 on: August 23, 2013, 11:52:03 PM »
Good for you, but people reading the board should be informed about this problem.

Fernando

PaceyIV

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #5 on: August 24, 2013, 03:17:06 PM »
Maybe there are some options in the kernel that can change the functionality.
I saw that there are some difference between your kernel config (posted in ReCompile Kernel for Debian Image) and Isidoro about USB and USB OTG.

XFer

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +4/-0
Re: loadavg always >=1.00 on debian
« Reply #6 on: August 24, 2013, 04:06:53 PM »
The whole USB support is flawed in 3.3.
I had to modify stuff in the usb drivers and in one of the Makefiles to have it work with at least one of my MIDI keyboards.
It's not a matter of config (mine is different because I needed more USB options to get MIDI keyboards working), in fact they are rewriting a lot of USB stuff for 3.4 (but 3.4 has other issues).  :-\

Anyway about the script.fex: a good compromise for the mini-USB port is

[usbc0]
usb_used = 1
usb_port_type = 1
usb_detect_type = 0
usb_id_gpio = port:PH04<0><1><default><default>
usb_det_vbus_gpio = port:PH05<0><0><default><default>
usb_drv_vbus_gpio = port:PB09<1><0><default><0>
usb_host_init_state = 1
usb_restric_flag = 0


which keeps the low load (low ksoftirq cpu usage) AND keeps OTG port (mini-USB) working both with USB 1.1 and with USB 2.0 devices, if only in Host mode (which is the most useful anyway).

Fernando

fitmik

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
Re: loadavg always >=1.00 on debian
« Reply #7 on: December 15, 2013, 10:41:08 PM »
Its not a problem specific to the 3.3 kernel. This is the same on 3.4.

I have this issue on both the A20 and the A10s boards with the last debian image from Olimex.


fitmik

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
Re: loadavg always >=1.00 on debian
« Reply #8 on: December 27, 2013, 06:59:02 PM »
Here is a quick how to fix this yourself:

git clone git://github.com/linux-sunxi/sunxi-tools.git
cd sunxi-tools/
make fex2bin

Then retrieve the original script_a20.fex from your sdcard and copy it.

vi script_a20.fex

I use this setup on the buggy USB port (thanks to Xfer) :

[usbc0]
usb_used = 1
usb_port_type = 1
usb_detect_type = 0
usb_id_gpio = port:PH04
usb_det_vbus_gpio = port:PH05
usb_drv_vbus_gpio = port:PB09
usb_host_init_state = 1
usb_restric_flag = 0

“which keeps the low load (low ksoftirq cpu usage) AND keeps OTG port (mini-USB) working both with USB 1.1 and with USB 2.0 devices, if only in Host mode (which is the most useful anyway).” Xfer

Then you convert it back to script bin.

./fex2bin -v script_a20.fex script.bin

And you copy it back to the root of your sdcard.

This should be the default until an official fix is found imho.
« Last Edit: December 27, 2013, 07:00:33 PM by fitmik »

fushfush

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: loadavg always >=1.00 on debian
« Reply #9 on: January 12, 2014, 11:29:13 AM »
There do you find that script then the A20 is started?

nabbal

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: loadavg always >=1.00 on debian
« Reply #10 on: December 02, 2015, 10:32:56 AM »
This issue still exists in the newer A20-OLinuXino-LIME2 Debian Jessie with kernel 3.4.103+ release 3.

I managed to fix it with the following commands:
Code: [Select]
sudo apt-get install build-essential libusb-1.0
sudo mount /dev/mmcblk0p1 /media/olimex/6B4C-FFFD
cd ~
git clone https://github.com/linux-sunxi/sunxi-tools
cd sunxi-tools
make
sudo su
./bin2fex /media/olimex/6B4C-FFFD/script.bin > /media/olimex/6B4C-FFFD/script.fex
vim /media/olimex/6B4C-FFFD/script.fex
#Change these values:
[usbc0]
usb_port_type = 1
usb_detect_type = 0
usb_host_init_state = 1
# save the file
cp /media/olimex/6B4C-FFFD/script.bin /media/olimex/6B4C-FFFD/script.bin.save
./fex2bin /media/olimex/6B4C-FFFD/script.fex /media/olimex/6B4C-FFFD/script.bin