Want to instantly get a 15% performance boost?
Then issue the following command:
echo "interrupt=no" > /proc/miscio/power_enable_config
I finally found out what is causing ksoftirqd so much grief! 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.
The only thing that keeps the problem from being *much* worse is that the gpio driver disables gpio interrupts while it applies a 10mS debounce period to the input pins. This action limits the total number of actual interrupts to only 100 / sec which is not so bad.
The performance hit comes from the way the debounce actually happens. In the driver, input pins are debounced by continuously rescheduling a bottom half tasklet until the 10mS debounce period has expired. Ksoftirqd was being charged with this CPU time. The sharing of time slices between this tasklet and other runnable, cpu bound, processes resulted in the degraded performance.
Here's the before and after execution time of a cpu intensive task:
# time /bin/tar tvzf junk.tgz > /opt/tmp/file.txt
real 4m 40.36s
user 3m 54.46s
sys 0m 3.02s
# echo "interrupt=no" > /proc/miscio/power_enable_config
# time /bin/tar tvzf junk.tgz > /opt/tmp/file.txt
real 4m 0.15s
user 3m 54.14s
sys 0m 3.04s
See how the real time went from 4:40.36 to 4:00.15? That's 16.7% faster!
One final thing, here's the new load average of my box:
load average: 0.14, 0.03, 0.01 ;-)
- K.C.