1. 09 May, 2019 6 commits
    • Russ Cox's avatar
      cmd/vet/all: update whitelist for vet fixes · b6f59cbc
      Russ Cox authored
      The vetall builder runs vet straight out of golang.org/x/tools,
      so submiting CL 176097 in that repo will break the builder
      by making all these whitelist entries stale.
      Submiting this CL will fix it, by removing them.
      
      The addition of the gcWriteBarrier declaration in runtime/stubs.go
      is necessary because the diagnostic is no longer emitted on arm,
      so it must be removed from all.txt. Adding it to runtime is better
      than adding it to every-other-goarch.txt.
      
      For #31916.
      
      Change-Id: I432f6049cd3ee5a467add5066c440be8616d9d54
      Reviewed-on: https://go-review.googlesource.com/c/go/+/176177
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      b6f59cbc
    • David Chase's avatar
      cmd/compile: test delve instead of gdb in ssa/debug_test.go · 5286b2ad
      David Chase authored
      This seems to deflake the test, and also allows testing
      on macOS.
      
      Fixes #31786.
      
      Change-Id: I10bfba46dd4b8e64cb09fdd4dd9d175c1ce1f022
      Reviewed-on: https://go-review.googlesource.com/c/go/+/176058
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5286b2ad
    • Than McIntosh's avatar
      cmd/link: fix link time regression in object file reading · 0793c810
      Than McIntosh authored
      In CL 173938, the linker's object file reader was switched over to
      selectively create strings backed with read-only mmap'd memory.
      In the process a call to r.rd.Offset() was added to readSymName(),
      which greatly increased the number of system calls (Offset does a
      seek system call).
      
      This patch changes the object file reader so that all reads are done
      directly from the mmap'd data if it is present, and adds logic to keep
      track of the offset within the rodata consumed so far. Doing this gets
      rid of the calls to r.rd.Offset() and the corresponding seek system
      calls.
      
      Also as part of this change, hoist the calls to objabi.PathToPrefix
      up into the initial setup code for object reading, and store the
      result in the reader (since objabi.PathToPrefix was also coming up
      as hot in the profile).
      
      Numbers for this change from compilebench:
      
      benchmark                 old ns/op       new ns/op       delta
      BenchmarkTemplate         172053975       170357597       -0.99%
      BenchmarkUnicode          64564850        64333653        -0.36%
      BenchmarkGoTypes          627931042       628043673       +0.02%
      BenchmarkCompiler         2982468893      2924575043      -1.94%
      BenchmarkSSA              9701681721      9799342557      +1.01%
      BenchmarkFlate            106847240       107509414       +0.62%
      BenchmarkGoParser         132082319       130734905       -1.02%
      BenchmarkReflect          386810586       383036621       -0.98%
      BenchmarkTar              154360072       152670594       -1.09%
      BenchmarkXML              217725693       216858727       -0.40%
      BenchmarkLinkCompiler     908813802       734363234       -19.20%
      BenchmarkStdCmd           32378532486     31222542974     -3.57%
      
      Fixes #31898.
      
      Change-Id: Ibf253a52ce9213325f42b1c2b20d0410f5c88c3b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/176039Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      0793c810
    • Elias Naur's avatar
      misc/android: silence adb output unless an error occurs · fb63ed2b
      Elias Naur authored
      Fixes #31917
      
      Change-Id: I794e457b2245d355e2df5077078c67aa09e00ff9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/175920
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fb63ed2b
    • Russ Cox's avatar
      cmd/asm: accept TEXT f+0(SB) in -gensymabis mode · f766b680
      Russ Cox authored
      f+0(SB) is a non-standard but acceptable alias for f(SB).
      
      Fixes #30968.
      
      Change-Id: I499ccee4d3ff3ab4e47f75d99407aace858e59aa
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174537Reviewed-by: default avatarAustin Clements <austin@google.com>
      f766b680
    • Russ Cox's avatar
      cmd/go: diagnose go.mod and vendor out of sync in std and cmd · 856b57e0
      Russ Cox authored
      The most common failure mode of the current std/cmd setup is
      going to be people running "go get m@latest" and then not running
      "go mod vendor" and being confused about getting the old m.
      Diagnose and report what to do.
      
      Also, having done the check, when in the standard library,
      switch the go command to -mod=vendor mode.
      This avoids some network accesses I saw when running
      'go clean -modcache' before doing some work in cmd.
      
      Change-Id: I0ba4a66637b67225a9b97a1c89f26f9015b41673
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174528
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      856b57e0
  2. 08 May, 2019 16 commits
  3. 07 May, 2019 6 commits
  4. 06 May, 2019 12 commits
    • Filippo Valsorda's avatar
      crypto/ed25519: promote from golang.org/x/crypto/ed25519 · 53374e7e
      Filippo Valsorda authored
      The crypto/tls and crypto/x509 APIs leak PublicKey and PrivateKey types,
      so in order to add support for Ed25519 certificates we need the ed25519
      package in the stdlib.
      
      It's also a primitive that's reasonable to use directly in applications,
      as it is a modern, safe and fast signing algorithm, for which there
      aren't higher level APIs. (The nacl/sign API is limiting in that it
      repeats the message.)
      
      A few docs changes will come in a follow-up, and a CL will land on
      golang.org/x/crypto/ed25519 to make it a type alias wrapper on Go 1.13+.
      
      Updates #25355
      
      Change-Id: I057f20cc7d1aca2b95c29ce73eb03c3b237e413f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174945
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      53374e7e
    • Bobby DeSimone's avatar
      net/url: add tests for URLHostname · 2729cd07
      Bobby DeSimone authored
      These changes add tests for URLHostname.
      
      Change-Id: Ie474516401a2236a9be65fb5c4e478322b1a199c
      GitHub-Last-Rev: 18f2d597be960c4d13cde12fef5d115926bff7bd
      GitHub-Pull-Request: golang/go#31832
      Reviewed-on: https://go-review.googlesource.com/c/go/+/175142Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2729cd07
    • Brad Fitzpatrick's avatar
      cmd/dist: allow builders to control granularity of test/ directory sharding · 6b1ac829
      Brad Fitzpatrick authored
      Even with 10 shards on builders, it still takes about ~2.5 minutes per
      shard (and getting slower all the time as the test/ directory grows).
      I'm currently experimenting with massively sharding out testing on
      Cloud Run (each dist test & normal TestFoo func all running in
      parallel), and in such a setup, 2.5 minutes is an eternity. I'd like
      to increase that dist test's sharding from 10 to more like 1,000.
      
      Updates golang/go#31834
      
      Change-Id: I8b02989727793b5b5b2013d67e1eb01ef4786e28
      Reviewed-on: https://go-review.googlesource.com/c/go/+/175297Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      6b1ac829
    • Shulhan's avatar
      all: simplify code using "gofmt -s -w" · ed7f323c
      Shulhan authored
      Most changes are removing redundant declaration of type when direct
      instantiating value of map or slice, e.g. []T{T{}} become []T{{}}.
      
      Small changes are removing the high order of subslice if its value
      is the length of slice itself, e.g. T[:len(T)] become T[:].
      
      The following file is excluded due to incompatibility with go1.4,
      
      - src/cmd/compile/internal/gc/ssa.go
      
      Change-Id: Id3abb09401795ce1e6da591a89749cba8502fb26
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166437
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      ed7f323c
    • Keith Randall's avatar
      reflect: special-case panic message when returning Value{} from MakeFunc function · 04845fe7
      Keith Randall authored
      Before this CL we used to panic with "nil pointer dereference" because
      the value we're calling assignTo on is the zero Value. Provide a better
      error message.
      
      Fixes #28748
      
      Change-Id: I7dd4c9e30b599863664d91e78cc45878d8b0052e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/175440
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      04845fe7
    • Michael Anthony Knyszek's avatar
      runtime: ensure free and unscavenged spans may be backed by huge pages · 31c4e099
      Michael Anthony Knyszek authored
      This change adds a new sysHugePage function to provide the equivalent of
      Linux's madvise(MADV_HUGEPAGE) support to the runtime. It then uses
      sysHugePage to mark a newly-coalesced free span as backable by huge
      pages to make the freeHugePages approximation a bit more accurate.
      
      The problem being solved here is that if a large free span is composed
      of many small spans which were coalesced together, then there's a chance
      that they have had madvise(MADV_NOHUGEPAGE) called on them at some point,
      which makes freeHugePages less accurate.
      
      For #30333.
      
      Change-Id: Idd4b02567619fc8d45647d9abd18da42f96f0522
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173338
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      31c4e099
    • Michael Anthony Knyszek's avatar
      runtime: split spans during allocation without treap removal · 5c15ed64
      Michael Anthony Knyszek authored
      Now that the treap is first-fit, we can make a nice optimization.
      Mainly, since we know that span splitting doesn't modify the relative
      position of a span in a treap, we can actually modify a span in-place
      on the treap. The only caveat is that we need to update the relevant
      metadata.
      
      To enable this optimization, this change introduces a mutate method on
      the iterator which takes a callback that is passed the iterator's span.
      The method records some properties of the span before it calls into the
      callback and then uses those records to see what changed and update
      treap metadata appropriately.
      
      Change-Id: I74f7d2ee172800828434ba0194d3d78d3942acf2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174879
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      5c15ed64
    • Michael Anthony Knyszek's avatar
      runtime: track the number of free unscavenged huge pages · f4a5ae55
      Michael Anthony Knyszek authored
      This change tracks the number of potential free and unscavenged huge
      pages which will be used to inform the rate at which scavenging should
      occur.
      
      For #30333.
      
      Change-Id: I47663e5ffb64cac44ffa10db158486783f707479
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170860
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      f4a5ae55
    • Michael Anthony Knyszek's avatar
      runtime: scavenge huge spans first · a62b5723
      Michael Anthony Knyszek authored
      This change adds two new treap iteration types: one for large
      unscavenged spans (contain at least one huge page) and one for small
      unscavenged spans. This allows us to scavenge the huge spans first by
      first iterating over the large ones, then the small ones.
      
      Also, since we now depend on physHugePageSize being a power of two,
      ensure that that's the case when it's retrieved from the OS.
      
      For #30333.
      
      Change-Id: I51662740205ad5e4905404a0856f5f2b2d2a5680
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174399
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      a62b5723
    • Michael Anthony Knyszek's avatar
      runtime: make treap iteration more efficient · fa8470a8
      Michael Anthony Knyszek authored
      This change introduces a treapIterFilter type which represents the
      power set of states described by a treapIterType.
      
      This change then adds a treapIterFilter field to each treap node
      indicating the types of spans that live in that subtree. The field is
      maintained via the same mechanism used to maintain maxPages. This allows
      pred, succ, start, and end to be judicious about which subtrees it will
      visit, ensuring that iteration avoids traversing irrelevant territory.
      
      Without this change, repeated scavenging attempts can end up being N^2
      as the scavenger walks over what it already scavenged before finding new
      spans available for scavenging.
      
      Finally, this change also only scavenges a span once it is removed from
      the treap. There was always an invariant that spans owned by the treap
      may not be mutated in-place, but with this change violating that
      invariant can cause issues with scavenging.
      
      For #30333.
      
      Change-Id: I8040b997e21c94a8d3d9c8c6accfe23cebe0c3d3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174878
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      fa8470a8
    • Michael Anthony Knyszek's avatar
      runtime: merge all treaps into one implementation · 9baa4301
      Michael Anthony Knyszek authored
      This change modifies the treap implementation to support holding all
      spans in a single treap, instead of keeping them all in separate treaps.
      
      This improves ergonomics for nearly all treap-related callsites.
      With that said, iteration is now more expensive, but it never occurs on
      the fast path, only on scavenging-related paths.
      
      This change opens up the opportunity for further optimizations, such as
      splitting spans without treap removal (taking treap removal off the span
      allocator's critical path) as well as improvements to treap iteration
      (building linked lists for each iteration type and managing them on
      insert/removal, since those operations should be less frequent).
      
      For #30333.
      
      Change-Id: I3dac97afd3682a37fda09ae8656a770e1369d0a9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/174398
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      9baa4301
    • Baokun Lee's avatar
      cmd/go/internal/modfile: make error message for module path more clear · 1ad2298c
      Baokun Lee authored
      Fixes #31775
      
      `
      
      Change-Id: I59c4e90f20d1b31161c259680b48b7be7218bf58
      Reviewed-on: https://go-review.googlesource.com/c/go/+/175017
      Run-TryBot: Baokun Lee <nototon@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      1ad2298c