I can confirm that the SuSE's 10.3 kernel (2.6.22) runs the program with a very low overhead, almost unnoticed by top. I have tried several combinations (tickless, 100 to 1000 HZ) on my vanilla 2.6.25 kernel.
With some combinations I have very high user loads, up to 40%, sometimes top indicates that the task is using about 33% of the CPU but the overall values are very low!
I noticed that many settings of the config.gz embedded into SuSE's kernel do not exist in the vanilla kernel.
If needed, I can post or send my .config file
That's the code I have used, but as you can see it's just a meat-and-potatoes test...
Code:
import serial, struct, time, signal
def read_from_ins():
a = ser.read(33)
if len(a) < 1:
return
print "read ",len(a)," bytes"
pattern = "B"*len(a)
outy = struct.unpack(pattern,a)
print "*** ",
for i in range(0, len(a)):
print hex(outy),
print " ***"
print "length:",len(a)
def int_handler(signum, frame):
print "exiting..."
ser.write(stop_baby)
ser.close()
exit
start_baby="\xbc\x05\x53\x54\x41\x52\x54\x45"
stop_baby="\xbc\x05\x52\x45\x53\x45\x54\x50"
reset_baby="\xbc\x04\x53\x54\x4f\x50\x1c"
hw_reset_baby="\xbc\x04\x48\x52\x53\x54\x19"
signal.signal(signal.SIGINT, int_handler)
ser = serial.Serial('/dev/ttyPSC0',115200)
print "port opened"
ser.write(hw_reset_baby)
print "uC reset"
time.sleep(1)
ser.write(start_baby)
while 1:
read_from_ins()