Re: About kernel function _CPU_Counter_difference overflow issue

2021-06-18 Thread Sebastian Huber
On 18/06/2021 10:25, wangqia...@sugon.com wrote:     1. Is it a bug?     static inline CPU_Counter_ticks _CPU_Counter_difference(         CPU_Counter_ticks second,        CPU_Counter_ticks first)     {          return second - first;     } The CPU_Counter_ticks is an unsigned integer, so t

About kernel function _CPU_Counter_difference overflow issue

2021-06-18 Thread wangqiang3
Hello, When reading profiling code, I found function '_CPU_Counter_difference' may overflow, and it will result in 'per_cpu->max_interrupt_time' become a wrong larger value. If a cpu counter is 32bit, and it's resolution is 800ns, the counter will overflow every 3436 seconds(_CPU_Counte