How to improve scheduler and interrupt latency:
Background:
- Embedded system based on 10 cores mips64 processor
- 9 cores run SMP linux. kernel version 2.6.32.27
- We have realtime performance required process which has to complete certain tasks within 1ms. At maximum load conditions it may take 800uS.
- This process starts the processing after receiving GPIO interrupt (1ms interrupt provided by FPGA. implemented as a kernel driver). Till then it will make a icotl call to gpio driver and will be put to sleep by the virtue of wake_up_interruptible system call
- The GPIO ISR will wake_up() this process
- To prevent other processes hogging CPU for this process, we run this process on an "isolcpus" core.
- We have set priority to be highest among user thread for this process as below: Priority: 80, Scheduling type:SCHED_FIFO threadSetRtPriority(SCHED_FIFO, 80);
- All /proc/sys/kernel/sched_ parameter values are default. We haven't fine tuned them
Problem:
- Sometimes we see that ISR has called wake_up, but the process is scheduled only after 350uS. This is a big time since our processor is running at 1.25GHz. This big number for scheduling latency, is puzzling us, as we have already isolated the core exclusively for this process by using "isolcpus"
- We profile the max CPU cycle count between consecutive 1ms GPIO ISR calls. This max time is more than 1.5ms. This big number for interrupt latency is too a concern for us, as this will eat up into the time available for the process to do its processing within 1ms boundary.
Please help us with inputs to reduce the interrupt and scheduling latency numbers