You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/10/20 18:28:00 UTC

[jira] [Commented] (IMPALA-15585) OsInfo does not understand that ARM's CLOCK_MONOTONIC is fast

    [ https://issues.apache.org/jira/browse/IMPALA-15585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18129282#comment-18129282 ] 

ASF subversion and git services commented on IMPALA-15585:
----------------------------------------------------------

Commit 64a7b8b8b9ab0676e37ade0663473fc6e854b2d4 in impala's branch refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=64a7b8b8b ]

IMPALA-15585: Detect fast CLOCK_MONOTONIC on ARM

In IMPALA-2407, Impala added logic to detect whether clock_gettime's
CLOCK_MONOTONIC has a fast implementation. At the time, some clock
implementations like Xen were very slow. To avoid the performance
penalty, it uses CLOCK_MONOTONIC_COARSE when the clock source
is not known to be fast.

ARM has a fast clock source for CLOCK_MONOTONIC, but it is not being
detected properly because it has a different name than x86_64.
ARM currently uses CLOCK_MONOTONIC_COARSE, which makes profile
time counters considerably less useful.

This adds detection for the ARM fast time counter (arch_sys_counter)
in addition to the x86_64 version (tsc).

Testing:
 - Ran a perf-AB-test on ARM and verified that the profiles have
   more exact time values (without performance regression)

Change-Id: I6512e5dbbb11c4816716deccce3c0e212f73cf33
Reviewed-on: http://gerrit.cloudera.org:8080/25149
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Yida Wu <wy...@gmail.com>
Reviewed-by: Jason Fehr <jf...@cloudera.com>


> OsInfo does not understand that ARM's CLOCK_MONOTONIC is fast
> -------------------------------------------------------------
>
>                 Key: IMPALA-15585
>                 URL: https://issues.apache.org/jira/browse/IMPALA-15585
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 5.0.0
>            Reporter: Joe McDonnell
>            Priority: Major
>
> OsInfo::Init() has logic to detect whether the clock_gettime has a fast CLOCK_MONOTONIC implementation. If it does not detect a fast implementation, it uses CLOCK_MONOTONIC_COARSE, which has significantly lower resolution. This is to protect against old clock implementations that are very slow (see IMPALA-2407). ARM has a high precision clocksource with equivalent speed to x86_64 for CLOCK_MONOTONIC, but it has a different name in the clocksource file. The algorithm doesn't detect it and uses the coarse timer. This makes time counters in ARM profiles much less useful.
> We should update the detection to properly detect this on ARM.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org