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

Use clock_gettime(CLOCK_MONOTONIC) in omrtime_hires_clock #7065

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Jul 18, 2023

Recently, gettimeofday was replaced with
clock_gettime(CLOCK_MONOTONIC_RAW) in omrtime_hires_clock.

This causes a 2-3% regression in startup time.

vDSO support for clock_gettime(CLOCK_MONOTONIC_RAW) was added in Linux
kernel version 5.3: https://bugzilla.kernel.org/show_bug.cgi?id=198961.

The aforementioned regression is seen on Linux kernel versions < 5.3.

Replacing CLOCK_MONOTONIC_RAW with CLOCK_MONOTONIC since it has vDSO
support for older Linux kernel versions, and it also resolves the above
regression in startup time.

Related:

Also, renamed J9TIME_NANO_CLOCK to OMRTIME_NANO_CLOCK.

Recently, gettimeofday was replaced with
clock_gettime(CLOCK_MONOTONIC_RAW) in omrtime_hires_clock.

This causes a 2-3% regression in startup time.

vDSO support for clock_gettime(CLOCK_MONOTONIC_RAW) was added in Linux
kernel version 5.3: https://bugzilla.kernel.org/show_bug.cgi?id=198961.

The aforementioned regression is seen on Linux kernel versions < 5.3.

Replacing CLOCK_MONOTONIC_RAW with CLOCK_MONOTONIC since it has vDSO
support for older Linux kernel versions, and it also resolves the above
regression in startup time.

Related:
- eclipse-omr#7041
- eclipse-omr#7044
- https://github.ibm.com/runtimes/javanext/issues/388
- https://github.ibm.com/runtimes/javanext/issues/389

Also, renamed J9TIME_NANO_CLOCK to OMRTIME_NANO_CLOCK.

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@babsingh
Copy link
Contributor Author

babsingh commented Jul 18, 2023

Perf numbers + vDSO support for CLOCK_MONOTONIC_RAW: https://lore.kernel.org/linux-arm-kernel/20190621095252.32307-1-vincenzo.frascino@arm.com.

Summary:

  • clock-gettime-monotonic and gettimeofday have similar performance.
  • clock-gettime-monotonic-raw is 15x slower than clock-gettime-monotonic and gettimeofday without vDSO support.

@babsingh
Copy link
Contributor Author

jenkins build all

@babsingh babsingh requested a review from knn-k July 18, 2023 16:27
@knn-k
Copy link
Contributor

knn-k commented Jul 18, 2023

Jenkins build aarch64,plinux,xlinux

@knn-k knn-k merged commit e7b3de6 into eclipse-omr:master Jul 18, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants