PDA

Bekijk de volledige versie : ksoftirqd_CPU0 eating CPU in firmware 1.0.4.6?



Hobi
14-10-2006, 21:43
Hi !

Thanks to the tutorial section about building a new firmware, I compiled firmware 1.0.4.6 myself with very little changes (only the startup script rcex was changed to start dropbear and twonkymusic as well as setting the hard disk parameters to spin down when idle).

When I also installed the tool "top" I discovered that the ksoftirqd_CPU0 is almost always using 100% CPU when the router is idle and still about 20% when there is heavy load, e.g. massive samba data transfers to/from hard disk.

While the router is still working pretty good and all services are available, the responsiveness could be better.

Could you please confirm that your router behaves the same as mine? Did anyone of you kernel/firmware hackers tried another kernel or another configuration where the problem does not occur?

Hobi

Perkouw
14-10-2006, 22:31
hi,

i'm noticing the weird thing that i can only upload to my router with a max of 5 mb/ps and also my down is 5 mb/ps

so

Asus router hdd >> hdd on my computer max down 5 mb/ps should be at least 50 mb/ps!!

someone a idea ??!!

DaNawq
14-10-2006, 22:47
Where do I have to edit the init files. In 1.0.4.2 there was a file service.ex in rc.asus but with 1.0.4.6 its gone. thx for that info. (the actual entry would also be nice ;) )

I have to test top little later, but already now I can tell you that I have sometime responsivness troubles using telnet or ftp. (Waits 5 secs before acting as expected)

fireflash
16-10-2006, 19:01
Hi !

Thanks to the tutorial section about building a new firmware, I compiled firmware 1.0.4.6 myself with very little changes (only the startup script rcex was changed to start dropbear and twonkymusic as well as setting the hard disk parameters to spin down when idle).

When I also installed the tool "top" I discovered that the ksoftirqd_CPU0 is almost always using 100% CPU when the router is idle and still about 20% when there is heavy load, e.g. massive samba data transfers to/from hard disk.

While the router is still working pretty good and all services are available, the responsiveness could be better.

Could you please confirm that your router behaves the same as mine? Did anyone of you kernel/firmware hackers tried another kernel or another configuration where the problem does not occur?

Hobi

Could you be persuaded to write a small tutorial on what script(s) require editing to start additional services on boot? And what needs to be done to get the HD to spin down? I'd give my right nu... umm, arm for that feature. :)

Also, anyone got a copy of dropbear compiled for MIPS that they can share? I'm not having much luck finding info on how to compile it, and I don't wanna leave telnetd running unsecure.

Hobi
30-10-2006, 22:22
Hi !

Sorry for the late answer, but I'm just back from holidays ...

I simply added the following lines to the end of the file WL700g/nasoc/src/apps/mipsel/exinstall/bin/rcex and rebuild the install image for firmware 1.0.4.6 as described in the tutorials:

# Run user defined "rc.local" if set in nvram ...
rclocal=`nvram get rc_local`
if [ -x $rclocal ]; then
$rclocal&
fi


Then set the nvram variable rc_local to a value pointing to your local startup script. My rc_local points to the following script (Don't forget to commit your changes to nvram permanently with "nvram commit", otherwise they are lost when rebooting):

#!/bin/ash
# Startup-Script for twonky-Music

if [ \! -f /tmp/rc.local ]; then
killall -STOP watchdog
mount -o remount,noatime,nodiratime /dev/se/2 /shares/MYVOLUME1
hdparm -S 50 /dev/ide/host2/bus0/target0/lun0/disc

swapoff /dev/md/0
killall mt-daapd
killall upnp

smartctl -dT /dev/ide/host2/bus0/target0/lun0/disc

/shares/MYVOLUME1/twonky/twonkymusic &

#SHH-Server starten
/shares/MYVOLUME1/MYSHARE1/bin/dropbear -r /shares/MYVOLUME1/MYSHARE1/etc/id_rsa

touch /tmp/rc.local
fi

This script disables some feature I don't need, starts twonkymusic and enables HDD spin down when the system is idle. Additionally dropbear is started to enable ssh login.

I hope this helps ...

Hobi

fireflash
31-10-2006, 00:20
That is awesome! I'm gonna take a stab at it in a few and see what blows up. :) Where did you get a mipsel version of dropbear? Or did you compile it yourself? This and getting enhanced-ctorrent to work is all that's really kicking my butt right now.

I also like the idea of killing the itunes server and uPnP.. while I do use iTunes (Mac user) having it show up as a server does me no good, so I'd rather save the precious few resources the router has for more important things, like downloading. :)

Thanks again man, I can't wait to try it!

MoD
31-10-2006, 06:23
Where do I have to edit the init files. In 1.0.4.2 there was a file service.ex in rc.asus but with 1.0.4.6 its gone. thx for that info. (the actual entry would also be nice ;) )

I have to test top little later, but already now I can tell you that I have sometime responsivness troubles using telnet or ftp. (Waits 5 secs before acting as expected)

If it is interesting to you, I think that it is possible to add mising rc sources from version 1.0.42.

kfurge
06-11-2006, 00:53
...
killall -STOP watchdog
mount -o remount,noatime,nodiratime /dev/se/2 /shares/MYVOLUME1
hdparm -S 50 /dev/ide/host2/bus0/target0/lun0/disc
...
Hobi

I'm curious, how'd you figure out you needed to send the STOP signal to watchdog?

- K.C.

Hobi
08-11-2006, 22:12
I'm curious, how'd you figure out you needed to send the STOP signal to watchdog?


... because it kept restarting when sending a SIGKILL. By sending a SIGSTOP the watchdog does not terminate and also still keeps allocated resources but it was an easy way to keep this program from constantly accessing the hard disk.

BrianKDav
12-05-2007, 06:26
I discovered that the ksoftirqd_CPU0 is almost always using 100% CPU when the router is idle and still about 20% when there is heavy load
From http://www.opensourcemanuals.org/manual/ksoftirqd/description:

DESCRIPTION - ksoftirqd is a per-cpu kernel thread that runs when the machine is under heavy soft-interrupt load. Soft interrupts are normally serviced on return from a hard interrupt, but it’s possible for soft interrupts to be triggered more quickly than they can be serviced. If a soft interrupt is triggered for a second time while soft interrupts are being handled, the ksoftirq daemon is triggered to handle the soft interrupts in process context. If ksoftirqd is taking more than a tiny percentage of CPU time, this indicates the machine is under heavy soft interrupt load.
So, what might be generating a "heavy soft interrupt load"? Maybe running top and killing one process at a time will generate an answer...

--Brian

hal2k1
12-05-2007, 16:04
From http://www.opensourcemanuals.org/manual/ksoftirqd/description:

So, what might be generating a "heavy soft interrupt load"? Maybe running top and killing one process at a time will generate an answer...

--Brian

http://wl500g.info/showthread.php?t=8573&highlight=ksoftirqd

Apparently, "It is the gpio driver. Turns out the +5V power on/off gpio is configured as an output (OK) and also an interrupt source (not OK). This results in a gpio interrupt storm."