Skip to content

runtime: GC stack shrinking is O(n²) in the number of goroutines blocked on one sync.Mutex since Go 1.26 [1.27 backport] #82190

Open

Description

@gopherbot

@prattmic requested issue #81957 to be considered for backport to the next 1.27 minor release.

@gopherbot Please backport https://go.dev/cl/847406 to Go 1.26 and 1.27. This is a performance regression making stack shrinking O(n^2) on the number of goroutines blocked on the same sync.Mutex. It can make the GC use extremely high CPU.

This regression was introduced in https://go.dev/cl/688335, which introduced GOEXPERIMENT=goroutineleakprofile. This GOEXPERIMENT was disabled by default in 1.26, but the regression is present whether the experiment is enabled or disabled, so 1.26 is affected as well.

Activity

  1. added
    CherryPickCandidateUsed during the release process for point releases
    compiler/runtimeIssues related to the Go compiler and/or runtime.
    on Oct 13, 2026
  2. modified the milestones: Go1.27.3, Go1.27.4 on Oct 13, 2026
  3. modified the milestones: Go1.27.4, Go1.27.5 on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CherryPickCandidateUsed during the release process for point releasescompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions