clock_gettime function doesn't scale to real time.. and changing CNTFRQ_EL0 doesn't make any change..(arm64)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: clock_gettime function doesn't scale to real time.. and changing CNTFRQ_EL0 doesn't make any change..(arm64)

Hello linux experts and newbies,

I have ported linux on our arm64 fpga board. Both 5.10.0 and 5.15.xx works ok with minimal config.

I have run a simple application and timed the processing time using clock_gettime function.

It felt like it took almost 2.3 seconds but the program say it took only 0.36 seconds.

Here is how I did  it in the application.

I used u-boot program for loading linux kernel and the u-boot program sets the CNTFRQ_EL0 register with 5000000.

(which is 5MHz, I heard the system clock runs at 5MHz in the board).

The description of the register in armv8 arch manual says :

This register is provided so that software can discover the frequency of the system counter. It must

be programmed with this value as part of system initialization. The value of the register is not

interpreted by hardware.

I tried setting the CNTFRQ_EL0 with 20Mhz, expecting the execution to be displayed 4 times shorter but it is the same!

I couldn't find how linux uses clock_gettime.

How can I solve this problem?

Any advice will be deeply appreciated.

Thank you!

Chan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux