vanzin commented on a change in pull request #26058: [SPARK-10614][core] Add 
monotonic time to Clock interface.
URL: https://github.com/apache/spark/pull/26058#discussion_r332714350
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
 ##########
 @@ -288,7 +288,7 @@ private[spark] class ExecutorAllocationManager(
     }
 
     // Update executor target number only after initializing flag is unset
-    updateAndSyncNumExecutorsTarget(clock.getTimeMillis())
+    updateAndSyncNumExecutorsTarget(clock.nanoTime())
 
 Review comment:
   That is interesting, but according to this:
   
       http://btorpey.github.io/blog/2014/02/18/clock-sources-in-linux/
   
   `CLOCK_MONOTONIC` uses RDTSC (or RDTSCP when available), which solves that 
problem. The preferred one (RDTSCP) seems to be available in all modern CPUs. 
So, `CLOCK_MONOTONIC` actually fulfills the requirements of the `nanoTime()` 
API (that the source of time is consistent).
   
   (The AMD K8 mentioned in your comment, which came out more than 10 years 
ago, is where RDTSCP was added.)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to