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

Steve Loughran commented on HADOOP-17600:
-----------------------------------------

see the related JIRAs. It's not as simple as "just switch and all will be good"

Also
*  
http://steveloughran.blogspot.com/2015/09/time-on-multi-core-multi-socket-servers.html
* https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6458294

At the time we last looked at it then, different cores in the same CPU socket 
could be running on different clocks. so if a thread got rescheduled monotonic 
now could jump.

Even though latest intel parts do, AFAIK, now share a clock in a single socket. 
multisocket servers don't sync time across parts. 

Then there's VMs whose clocks are all simulated in software, or at least 
translated from underlying hardware.

I think monotonic time is good for microbenchmarks, but not sure its 
appropriate for measuring the duration of operations which are generally 
non-blocking (i.e. no I/I, short lived), but really unsure about how well it 
works for bigger bits of work.


At the same time, we know Time.now() is brittle to NTP and VM pause/resume.

Before accepting any changes in this area then, I'd like to know where things 
stand with regard to monotonicity across cores and sockets of recent intel, AMD 
and ARM parts, and what happens in modern container and VM cloud deployments. 
# are things better than before?
# are things better than time.now?
# what causes the counters to (a) not change over any time period and (b) go 
backwards?

This is not as trivial change as it appears.  At the same time, it's clear we 
don't have it "right" today.


> Time.monotonicNow() should be used to compute time interval, but not 
> Time.now()
> -------------------------------------------------------------------------------
>
>                 Key: HADOOP-17600
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17600
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common
>            Reporter: Jiajun Jiang
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HADOOP-17600.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> According to the specification of method Time.now() and Time.monotonicNow(), 
> the latter should be used for measuring durations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to