1. 21 Nov, 2017 10 commits
    • Jamie Liu's avatar
      runtime: only sleep before stealing work from a running P · 868c8b37
      Jamie Liu authored
      The sleep in question does not make sense if the stolen-from P cannot
      run the stolen G. The usleep(3) has been observed delaying execution of
      woken G's by ~60us; skipping it reduces the wakeup-to-execution latency
      to ~7us in these cases, improving CPU utilization.
      
      Benchmarks added by this change:
      
      name                             old time/op  new time/op  delta
      WakeupParallelSpinning/0s-12     14.4µs ± 1%  14.3µs ± 1%     ~     (p=0.227 n=19+20)
      WakeupParallelSpinning/1µs-12    18.3µs ± 0%  18.3µs ± 1%     ~     (p=0.950 n=20+19)
      WakeupParallelSpinning/2µs-12    22.3µs ± 1%  22.3µs ± 1%     ~     (p=0.670 n=20+18)
      WakeupParallelSpinning/5µs-12    31.7µs ± 0%  31.7µs ± 0%     ~     (p=0.460 n=20+17)
      WakeupParallelSpinning/10µs-12   51.8µs ± 0%  51.8µs ± 0%     ~     (p=0.883 n=20+20)
      WakeupParallelSpinning/20µs-12   91.9µs ± 0%  91.9µs ± 0%     ~     (p=0.245 n=20+20)
      WakeupParallelSpinning/50µs-12    214µs ± 0%   214µs ± 0%     ~     (p=0.509 n=19+20)
      WakeupParallelSpinning/100µs-12   335µs ± 0%   335µs ± 0%   -0.05%  (p=0.006 n=17+15)
      WakeupParallelSyscall/0s-12       228µs ± 2%   129µs ± 1%  -43.32%  (p=0.000 n=20+19)
      WakeupParallelSyscall/1µs-12      232µs ± 1%   131µs ± 1%  -43.60%  (p=0.000 n=19+20)
      WakeupParallelSyscall/2µs-12      236µs ± 1%   133µs ± 1%  -43.44%  (p=0.000 n=18+19)
      WakeupParallelSyscall/5µs-12      248µs ± 2%   139µs ± 1%  -43.68%  (p=0.000 n=18+19)
      WakeupParallelSyscall/10µs-12     263µs ± 3%   150µs ± 2%  -42.97%  (p=0.000 n=18+20)
      WakeupParallelSyscall/20µs-12     281µs ± 2%   170µs ± 1%  -39.43%  (p=0.000 n=19+19)
      WakeupParallelSyscall/50µs-12     345µs ± 4%   246µs ± 7%  -28.85%  (p=0.000 n=20+20)
      WakeupParallelSyscall/100µs-12    460µs ± 5%   350µs ± 4%  -23.85%  (p=0.000 n=20+20)
      
      Benchmarks associated with the change that originally added this sleep
      (see https://golang.org/s/go15gomaxprocs):
      
      name        old time/op  new time/op  delta
      Chain       19.4µs ± 2%  19.3µs ± 1%    ~     (p=0.101 n=19+20)
      ChainBuf    19.5µs ± 2%  19.4µs ± 2%    ~     (p=0.840 n=19+19)
      Chain-2     19.9µs ± 1%  19.9µs ± 2%    ~     (p=0.734 n=19+19)
      ChainBuf-2  20.0µs ± 2%  20.0µs ± 2%    ~     (p=0.175 n=19+17)
      Chain-4     20.3µs ± 1%  20.1µs ± 1%  -0.62%  (p=0.010 n=19+18)
      ChainBuf-4  20.3µs ± 1%  20.2µs ± 1%  -0.52%  (p=0.023 n=19+19)
      Powser       2.09s ± 1%   2.10s ± 3%    ~     (p=0.908 n=19+19)
      Powser-2     2.21s ± 1%   2.20s ± 1%  -0.35%  (p=0.010 n=19+18)
      Powser-4     2.31s ± 2%   2.31s ± 2%    ~     (p=0.578 n=18+19)
      Sieve        13.6s ± 1%   13.6s ± 1%    ~     (p=0.909 n=17+18)
      Sieve-2      8.02s ±52%   7.28s ±15%    ~     (p=0.336 n=20+16)
      Sieve-4      4.00s ±35%   3.98s ±26%    ~     (p=0.654 n=20+18)
      
      Change-Id: I58edd8ce01075859d871e2348fc0833e9c01f70f
      Reviewed-on: https://go-review.googlesource.com/78538Reviewed-by: 's avatarAustin Clements <austin@google.com>
      868c8b37
    • Florian Uekermann's avatar
      time: enable Location loading from user provided timezone data · 2951f909
      Florian Uekermann authored
      The return values of the LoadLocation are inherently dependent
      on the runtime environment. Add LoadLocationFromTZData, whose
      results depend only on the timezone data provided as arguments.
      
      Fixes #20629
      
      Change-Id: I43b181f4c05c219be3ec57327540263b7cb3b2aa
      Reviewed-on: https://go-review.googlesource.com/68890Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      2951f909
    • Wei Xiao's avatar
      bytes: add optimized countByte for arm64 · 9a14cd9e
      Wei Xiao authored
      Use SIMD instructions when counting a single byte.
      Inspired from runtime IndexByte implementation.
      
      Benchmark results of bytes, where 1 byte in every 8 is the one we are looking:
      
      name               old time/op   new time/op    delta
      CountSingle/10-8    96.1ns ± 1%    38.8ns ± 0%    -59.64%  (p=0.000 n=9+7)
      CountSingle/32-8     172ns ± 2%      36ns ± 1%    -79.27%  (p=0.000 n=10+10)
      CountSingle/4K-8    18.2µs ± 1%     0.9µs ± 0%    -95.17%  (p=0.000 n=9+10)
      CountSingle/4M-8    18.4ms ± 0%     0.9ms ± 0%    -95.00%  (p=0.000 n=10+9)
      CountSingle/64M-8    284ms ± 4%      19ms ± 0%    -93.40%  (p=0.000 n=10+10)
      
      name               old speed     new speed      delta
      CountSingle/10-8   104MB/s ± 1%   258MB/s ± 0%   +147.99%  (p=0.000 n=9+10)
      CountSingle/32-8   185MB/s ± 1%   897MB/s ± 1%   +385.33%  (p=0.000 n=9+10)
      CountSingle/4K-8   225MB/s ± 1%  4658MB/s ± 0%  +1967.40%  (p=0.000 n=9+10)
      CountSingle/4M-8   228MB/s ± 0%  4555MB/s ± 0%  +1901.71%  (p=0.000 n=10+9)
      CountSingle/64M-8  236MB/s ± 4%  3575MB/s ± 0%  +1414.69%  (p=0.000 n=10+10)
      
      Change-Id: Ifccb51b3c8658c49773fe05147c3cf3aead361e5
      Reviewed-on: https://go-review.googlesource.com/71111Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9a14cd9e
    • Than McIntosh's avatar
      cmd/compile: ignore RegKill ops for non-phi after phi check · 63ef3cde
      Than McIntosh authored
      Relax the 'phi after non-phi' SSA sanity check to allow
      RegKill ops interspersed with phi ops in a block. This fixes
      a sanity check failure when -dwarflocationlists is enabled.
      
      Updates #22694.
      
      Change-Id: Iaae604ab6f1a8b150664dd120003727a6fb2f698
      Reviewed-on: https://go-review.googlesource.com/77610
      Run-TryBot: Than McIntosh <thanm@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      63ef3cde
    • Cherry Zhang's avatar
      cmd/compile: fix comment that -N does not disable escape analysis · 4fbf54fa
      Cherry Zhang authored
      -N does not disable escape analysis. Remove the outdated comment.
      
      Change-Id: I96978b3afd51324b7b4f8035cf4417fb2eac4ebc
      Reviewed-on: https://go-review.googlesource.com/79015Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      4fbf54fa
    • Russ Cox's avatar
      time: rename internal type data to dataIO · 225a2e12
      Russ Cox authored
      This allows LoadTimezoneFromTZData to have a parameter named data.
      
      Change-Id: I11c115745c7f697244f806bcd654f697dab73de1
      Reviewed-on: https://go-review.googlesource.com/79017
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      225a2e12
    • Tobias Klauser's avatar
      net: fix typo in parsePort documentation · 1a7ce9dd
      Tobias Klauser authored
      Change-Id: Ia302d9018690cd26890f874c70bd0c429a4b51f0
      Reviewed-on: https://go-review.googlesource.com/78975Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      1a7ce9dd
    • David Chase's avatar
      cmd/compile: improve debugging output for GOSSAFUNC · bd41c678
      David Chase authored
      This changes the assembly language output to use the
      innermost (instead of outermost) position for line
      number and file.
      
      The file is printed separately, only when it changes,
      to remove redundant and space-consuming noise from the
      output.
      
      Unknown positions have line number "?"
      
      The output format was changed slightly to make it
      easier to read.
      
      One source of gratuitous variation in debugging output was
      removed.
      
      Change-Id: I1fd9c8b0ddd82766488582fb684dce4b04f35723
      Reviewed-on: https://go-review.googlesource.com/78895
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      bd41c678
    • Heschi Kreinick's avatar
      cmd/link: use . as DW_AT_comp_dir · 4a3d408d
      Heschi Kreinick authored
      Go's DWARF usually has absolute paths, in which case DW_AT_comp_dir
      doesn't matter. But the -trimpath flag produces relative paths, and
      then the spec says that they are relative to _comp_dir.
      
      There's no way to know what the "right" value of _comp_dir is without
      more user input, but we can at least leave the paths alone rather than
      making them absolute.
      
      After this change, Delve can find sources to a program built with
      -gcflags=-trimpath=$(pwd) as long as it's run in the right directory.
      
      Change-Id: I8bc7bed098e352d2c06800bfbbe14e8392e1bbed
      Reviewed-on: https://go-review.googlesource.com/78415
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      4a3d408d
    • fanzha02's avatar
      cmd/internal/obj/arm64: fix assemble msr/mrs bug · 556fb16b
      fanzha02 authored
      The arguments <pstatefield> is a struct that includes two elements,
      element reg is special register, elememt enc is pstate field values.
      The current code compares two different type values and get a incorrect
      result.
      
      The fix follows pstate field to create a systemreg struct,
      each system register has a vaule to use in instruction.
      
      Uncomment the msr/mrs cases.
      
      Fixes #21464
      
      Change-Id: I1bb1587ec8548f3e4bd8d5be4d7127bd10d53186
      Reviewed-on: https://go-review.googlesource.com/56030Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      556fb16b
  2. 20 Nov, 2017 3 commits
    • Emmanuel Odeke's avatar
      cmd/compile: hint on wrong case-field names in composite literals · 5f29a7a7
      Emmanuel Odeke authored
      Improve the error message for wrong
      case-field names in composite literals,
      by mentioning the correct field name.
      
      Given the program:
      package main
      
      type it struct {
              ID string
      }
      
      func main() {
              i1 := &it{id: "Bar"}
      }
      
      just like we do for usage of fields, we now
      report wrongly cased fields as hints to give:
      
      ts.go:8:14: unknown field 'id' in struct literal of type it (but does have ID)
      
      instead of before:
      
      ts.go:8:14: unknown field 'id' in struct literal of type it
      
      Fixes #22794
      
      Change-Id: I18cd70e75817025cb1df083503cae306e8d659fd
      Reviewed-on: https://go-review.googlesource.com/78545
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      5f29a7a7
    • fanzha02's avatar
      cmd/internal/obj/arm64: fix assemble hlt/hvc/smc/brk/clrex bug · 436f2d8d
      fanzha02 authored
      When instruction has only one argument, Go parser saves the
      argument value into prog.From without any special handling.
      But assembler gets the argument value from prog.To.
      
      The fix adds special handling for CLREX and puts other instructions
      arguments value into prog.From.
      
      Uncomment hlt/hvc/smc/brk/dcps1/dcps2/dcps3/clrex test cases.
      
      Fixes #20765
      
      Change-Id: I1fc0d2faafb19b537cab5a665bd4af56c3a2c925
      Reviewed-on: https://go-review.googlesource.com/78275
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      436f2d8d
    • Rob Pike's avatar
      cmd/doc: don't print a declaration twice · 337f04bd
      Rob Pike authored
      That can occur if we have -u set and there is an upper- and lower-case
      name of the same spelling in a single declaration.
      
      A rare corner case but easy to fix.
      
      Fix by remembering what we've printed.
      
      Fixes #21797.
      
      Change-Id: Ie0b681ae8c277fa16e9635ba594c1dff272b8aeb
      Reviewed-on: https://go-review.googlesource.com/78715Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      337f04bd
  3. 19 Nov, 2017 5 commits
  4. 18 Nov, 2017 8 commits
  5. 17 Nov, 2017 11 commits
  6. 16 Nov, 2017 3 commits