Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64 cycle count with frequency #179

Merged
merged 1 commit into from
Aug 22, 2023
Merged

aarch64 cycle count with frequency #179

merged 1 commit into from
Aug 22, 2023

Conversation

Coldwings
Copy link
Collaborator

AArch64 CPU may using off-core timer as source of cntvct_el0 registers, so the counter may not fit CPU working frequency. The timer frequency on Apple M1 is 24MHz, much lower than CPU working frequency, that may make photon::now timestamp update about every 40ms, may makes photon thread sleeps longer than it should be.

The fix uses cntvct_el0 as a fast check whether should update time stamp, calculate with cntfrq_el0 as timer frequency, make it able to update timestamp as it designed to.

@lihuiba lihuiba merged commit c5fb639 into alibaba:main Aug 22, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants