Scheduler Latency Issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scheduler Latency Issue

616 Views
jackou
Contributor I

Hi,

I am working on LS1021a.  I have used 2 community BSPs for the project:

Morty (kernel 4.1.30) and

Rocko (kernel 4.9.178).

I patch Rocko kernel to 178 and both with RT patch. Both work fine and the real time patch does the job.   

But I just found a very strange issue in Rocko.  

I have a simple user process and it calls "usleep(400)" in the code, the system is almost idle, the process is having high real time priority.   I measure the sleep time for this call, under morty, it is reasonable to be 400+ usec, but for Rocko, it is always around 10 ms.    

I am sure no other processes are competing for CPU, the load average is almost 0.   It seems in Rocko, once process gives up CPU (usleep 400), it takes around 10ms to get it back.   It is not happening in morty.   

Does anyone know there is such an issue in Rocko or 4.9 kernel ?  It seems a scheduler latency problem.  

or is there any better way to track down why there is extract wait time added ? 

Thanks a lot !

Regards,

Jack

0 Kudos
1 Reply

543 Views
jackou
Contributor I

I get a patch from NXP, it works fine and solves this issue.

---
arch/arm/kernel/time.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 97b22fa..253de76 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -26,6 +26,7 @@
#include <linux/time.h>
#include <linux/timex.h>
#include <linux/timer.h>
+#include <linux/clockchips.h>

#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -121,5 +122,6 @@ void __init time_init(void)
of_clk_init(NULL);
#endif
clocksource_probe();
+ tick_setup_hrtimer_broadcast();
}
}
--
2.9.5

0 Kudos