• Austin Clements's avatar
    runtime: make STW duration more accurate · 250a9610
    Austin Clements authored
    Currently, GC captures the start-the-world time stamp after
    startTheWorldWithSema returns. This is problematic for two reasons:
    
    1. It's possible to get preempted between startTheWorldWithSema
    starting the world and calling nanotime.
    
    2. startTheWorldWithSema does several clean-up tasks after the world
    is up and running that on rare occasions can take upwards of 10ms.
    
    Since the runtime uses the start-the-world time stamp to compute the
    STW duration, both of these can significantly inflate the reported STW
    duration.
    
    Fix this by having startTheWorldWithSema itself call nanotime once the
    world is started.
    
    Change-Id: I114630234fb73c9dabae50a2ef1884661f2459db
    Reviewed-on: https://go-review.googlesource.com/55410
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    250a9610
proc.go 128 KB