[go] runtime: reduce contention in (*lfstack).pop

45 views
Skip to first unread message

Fannie Zhang (Gerrit)

unread,
Mar 4, 2025, 9:48:36 PM3/4/25
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Fannie Zhang has uploaded the change for review

Commit message

runtime: reduce contention in (*lfstack).pop

When profiling CPU usage LiveKit on AArch64/x86 (AWS), the graphs show
CPU spikes that was repeating in a semi-periodic manner and spikes occur
when the GC(garbage collector) is active.

Our analysis found that the getempty function accounted for 10.54% of the
overhead, which was mainly caused by the work.empty.pop() function. And
listing pop shows that the majority of the time, with a 10.29% overhead,
is spent on atomic.Cas64((*uint64)(head), old, next).

This patch adds a backoff approach to reduce the high overhead of the
atomic operation primarily occurs when contention over a specific memory
address increases, typically with the rise in the number of threads

This patch adds a new function nano_delay(), which is an Armv8.0-A compatible
delay function using the counter-timer.

The garbage collector benchmark:

│ master │ opt │
│ sec/op │ sec/op vs base │
Garbage/benchmem-MB=64-160 3.782m ± 4% 2.264m ± 2% -40.12% (p=0.000 n=10)
│ user+sys-sec/op │ user+sys-sec/op vs base │
Garbage/benchmem-MB=64-160 433.5m ± 4% 255.4m ± 2% -41.08% (p=0.000 n=10)

Reference for backoff mechianism:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94

Change diff

diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s
index 6c447ac..24e264d 100644
--- a/src/runtime/asm_arm64.s
+++ b/src/runtime/asm_arm64.s
@@ -970,6 +970,47 @@
CBNZ R0, again
RET

+// The Arm architecture provides a user space accessible counter-timer which
+// is incremented at a fixed but machine-specific rate. Software can (spin)
+// wait until the counter-timer reaches some desired value.
+// Armv8.7-A introduced the WFET (FEAT_WFxT) instruction, which allows the
+// processor to enter a low power state for a set time, or until an event is
+// received.
+// Without this feature, we can instead use the ISB instruction to
+// decrease processor activity and thus power consumption between checks of
+// the counter-timer. Note that we do not depend on the latency of the ISB instruction.
+// Read more in this Arm blog post:
+// https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
+
+TEXT runtime·nano_delay(SB),NOSPLIT,$0-0
+ MOVWU backoff_ns+0(FP), R0
+ ISB $15
+ CMP $0x12, R0
+ BLS ret
+ SUB $0x12, R0, R0
+ MRS CNTFRQ_EL0, R1
+ ADD R0<<4, R0, R0
+ MUL R1, R0, R0
+ LSR $30, R0, R0
+ CBZ R0, ret
+ MRS CNTVCT_EL0, R2
+ CMP $0x28, R0
+ BLS loop
+ SUB $0x28, R0, R3
+delay:
+ ISB $15
+ MRS CNTVCT_EL0, R1
+ SUB R2, R1, R1
+ CMP R3, R1
+ BCC delay
+loop:
+ MRS CNTVCT_EL0, R1
+ SUB R2, R1, R1
+ CMP R0, R1
+ BCC loop
+ret:
+ RET
+
// Save state of caller into g->sched,
// but using fake PC from systemstack_switch.
// Must only be called from functions with no locals ($0)
diff --git a/src/runtime/lfstack.go b/src/runtime/lfstack.go
index cbec6e8..11b0eee 100644
--- a/src/runtime/lfstack.go
+++ b/src/runtime/lfstack.go
@@ -37,20 +37,6 @@
}
}

-func (head *lfstack) pop() unsafe.Pointer {
- for {
- old := atomic.Load64((*uint64)(head))
- if old == 0 {
- return nil
- }
- node := lfstackUnpack(old)
- next := atomic.Load64(&node.next)
- if atomic.Cas64((*uint64)(head), old, next) {
- return unsafe.Pointer(node)
- }
- }
-}
-
func (head *lfstack) empty() bool {
return atomic.Load64((*uint64)(head)) == 0
}
diff --git a/src/runtime/mspanset.go b/src/runtime/mspanset.go
index 3aa2b5b..f535002 100644
--- a/src/runtime/mspanset.go
+++ b/src/runtime/mspanset.go
@@ -136,90 +136,6 @@
block.spans[bottom].StoreNoWB(s)
}

-// pop removes and returns a span from buffer b, or nil if b is empty.
-// pop is safe to call concurrently with other pop and push operations.
-func (b *spanSet) pop() *mspan {
- var head, tail uint32
-claimLoop:
- for {
- headtail := b.index.load()
- head, tail = headtail.split()
- if head >= tail {
- // The buf is empty, as far as we can tell.
- return nil
- }
- // Check if the head position we want to claim is actually
- // backed by a block.
- spineLen := b.spineLen.Load()
- if spineLen <= uintptr(head)/spanSetBlockEntries {
- // We're racing with a spine growth and the allocation of
- // a new block (and maybe a new spine!), and trying to grab
- // the span at the index which is currently being pushed.
- // Instead of spinning, let's just notify the caller that
- // there's nothing currently here. Spinning on this is
- // almost definitely not worth it.
- return nil
- }
- // Try to claim the current head by CASing in an updated head.
- // This may fail transiently due to a push which modifies the
- // tail, so keep trying while the head isn't changing.
- want := head
- for want == head {
- if b.index.cas(headtail, makeHeadTailIndex(want+1, tail)) {
- break claimLoop
- }
- headtail = b.index.load()
- head, tail = headtail.split()
- }
- // We failed to claim the spot we were after and the head changed,
- // meaning a popper got ahead of us. Try again from the top because
- // the buf may not be empty.
- }
- top, bottom := head/spanSetBlockEntries, head%spanSetBlockEntries
-
- // We may be reading a stale spine pointer, but because the length
- // grows monotonically and we've already verified it, we'll definitely
- // be reading from a valid block.
- blockp := b.spine.Load().lookup(uintptr(top))
-
- // Given that the spine length is correct, we know we will never
- // see a nil block here, since the length is always updated after
- // the block is set.
- block := blockp.Load()
- s := block.spans[bottom].Load()
- for s == nil {
- // We raced with the span actually being set, but given that we
- // know a block for this span exists, the race window here is
- // extremely small. Try again.
- s = block.spans[bottom].Load()
- }
- // Clear the pointer. This isn't strictly necessary, but defensively
- // avoids accidentally re-using blocks which could lead to memory
- // corruption. This way, we'll get a nil pointer access instead.
- block.spans[bottom].StoreNoWB(nil)
-
- // Increase the popped count. If we are the last possible popper
- // in the block (note that bottom need not equal spanSetBlockEntries-1
- // due to races) then it's our responsibility to free the block.
- //
- // If we increment popped to spanSetBlockEntries, we can be sure that
- // we're the last popper for this block, and it's thus safe to free it.
- // Every other popper must have crossed this barrier (and thus finished
- // popping its corresponding mspan) by the time we get here. Because
- // we're the last popper, we also don't have to worry about concurrent
- // pushers (there can't be any). Note that we may not be the popper
- // which claimed the last slot in the block, we're just the last one
- // to finish popping.
- if block.popped.Add(1) == spanSetBlockEntries {
- // Clear the block's pointer.
- blockp.StoreNoWB(nil)
-
- // Return the block to the block pool.
- spanSetBlockPool.free(block)
- }
- return s
-}
-
// reset resets a spanSet which is empty. It will also clean up
// any left over blocks.
//
diff --git a/src/runtime/pop.go b/src/runtime/pop.go
new file mode 100644
index 0000000..fd093c9
--- /dev/null
+++ b/src/runtime/pop.go
@@ -0,0 +1,111 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !arm64
+
+package runtime
+
+import (
+ "internal/runtime/atomic"
+ "unsafe"
+)
+
+// free-stack
+func (head *lfstack) pop() unsafe.Pointer {
+ for {
+ old := atomic.Load64((*uint64)(head))
+ if old == 0 {
+ return nil
+ }
+ node := lfstackUnpack(old)
+ next := atomic.Load64(&node.next)
+ if atomic.Cas64((*uint64)(head), old, next) {
+ return unsafe.Pointer(node)
+ }
+ }
+}
+
+// pop removes and returns a span from buffer b, or nil if b is empty.
+// pop is safe to call concurrently with other pop and push operations.
+func (b *spanSet) pop() *mspan {
+ var head, tail uint32
+claimLoop:
+ for {
+ headtail := b.index.load()
+ head, tail = headtail.split()
+ if head >= tail {
+ // The buf is empty, as far as we can tell.
+ return nil
+ }
+ // Check if the head position we want to claim is actually
+ // backed by a block.
+ spineLen := b.spineLen.Load()
+ if spineLen <= uintptr(head)/spanSetBlockEntries {
+ // We're racing with a spine growth and the allocation of
+ // a new block (and maybe a new spine!), and trying to grab
+ // the span at the index which is currently being pushed.
+ // Instead of spinning, let's just notify the caller that
+ // there's nothing currently here. Spinning on this is
+ // almost definitely not worth it.
+ return nil
+ }
+ // Try to claim the current head by CASing in an updated head.
+ // This may fail transiently due to a push which modifies the
+ // tail, so keep trying while the head isn't changing.
+ want := head
+ for want == head {
+ if b.index.cas(headtail, makeHeadTailIndex(want+1, tail)) {
+ break claimLoop
+ }
+ headtail = b.index.load()
+ head, tail = headtail.split()
+ }
+ // We failed to claim the spot we were after and the head changed,
+ // meaning a popper got ahead of us. Try again from the top because
+ // the buf may not be empty.
+ }
+ top, bottom := head/spanSetBlockEntries, head%spanSetBlockEntries
+
+ // We may be reading a stale spine pointer, but because the length
+ // grows monotonically and we've already verified it, we'll definitely
+ // be reading from a valid block.
+ blockp := b.spine.Load().lookup(uintptr(top))
+
+ // Given that the spine length is correct, we know we will never
+ // see a nil block here, since the length is always updated after
+ // the block is set.
+ block := blockp.Load()
+ s := block.spans[bottom].Load()
+ for s == nil {
+ // We raced with the span actually being set, but given that we
+ // know a block for this span exists, the race window here is
+ // extremely small. Try again.
+ s = block.spans[bottom].Load()
+ }
+ // Clear the pointer. This isn't strictly necessary, but defensively
+ // avoids accidentally re-using blocks which could lead to memory
+ // corruption. This way, we'll get a nil pointer access instead.
+ block.spans[bottom].StoreNoWB(nil)
+
+ // Increase the popped count. If we are the last possible popper
+ // in the block (note that bottom need not equal spanSetBlockEntries-1
+ // due to races) then it's our responsibility to free the block.
+ //
+ // If we increment popped to spanSetBlockEntries, we can be sure that
+ // we're the last popper for this block, and it's thus safe to free it.
+ // Every other popper must have crossed this barrier (and thus finished
+ // popping its corresponding mspan) by the time we get here. Because
+ // we're the last popper, we also don't have to worry about concurrent
+ // pushers (there can't be any). Note that we may not be the popper
+ // which claimed the last slot in the block, we're just the last one
+ // to finish popping.
+ if block.popped.Add(1) == spanSetBlockEntries {
+ // Clear the block's pointer.
+ blockp.StoreNoWB(nil)
+
+ // Return the block to the block pool.
+ spanSetBlockPool.free(block)
+ }
+ return s
+}
diff --git a/src/runtime/pop_arm64.go b/src/runtime/pop_arm64.go
new file mode 100644
index 0000000..f52a127
--- /dev/null
+++ b/src/runtime/pop_arm64.go
@@ -0,0 +1,128 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Lock-free stack.
+
+package runtime
+
+import (
+ "internal/runtime/atomic"
+ "unsafe"
+)
+
+func (head *lfstack) pop() unsafe.Pointer {
+ var backoff uint32 = 128
+ for {
+ old := atomic.Load64((*uint64)(head))
+ if old == 0 {
+ return nil
+ }
+ node := lfstackUnpack(old)
+ next := atomic.Load64(&node.next)
+ if atomic.Cas64((*uint64)(head), old, next) {
+ return unsafe.Pointer(node)
+ }
+ // Use a backoff approach to reduce demand to the shared memory location
+ // decreases memory contention and allows for other threads to make quicker
+ // progress.
+ // Read more in this Arm blog post:
+ // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
+ nano_delay(backoff)
+ // Increase backoff time.
+ backoff += backoff >> 1
+ }
+}
+
+// pop removes and returns a span from buffer b, or nil if b is empty.
+// pop is safe to call concurrently with other pop and push operations.
+func (b *spanSet) pop() *mspan {
+ var head, tail uint32
+ var backoff uint32 = 128
+claimLoop:
+ for {
+ headtail := b.index.load()
+ head, tail = headtail.split()
+ if head >= tail {
+ // The buf is empty, as far as we can tell.
+ return nil
+ }
+ // Check if the head position we want to claim is actually
+ // backed by a block.
+ spineLen := b.spineLen.Load()
+ if spineLen <= uintptr(head)/spanSetBlockEntries {
+ // We're racing with a spine growth and the allocation of
+ // a new block (and maybe a new spine!), and trying to grab
+ // the span at the index which is currently being pushed.
+ // Instead of spinning, let's just notify the caller that
+ // there's nothing currently here. Spinning on this is
+ // almost definitely not worth it.
+ return nil
+ }
+ // Try to claim the current head by CASing in an updated head.
+ // This may fail transiently due to a push which modifies the
+ // tail, so keep trying while the head isn't changing.
+ want := head
+ for want == head {
+ if b.index.cas(headtail, makeHeadTailIndex(want+1, tail)) {
+ break claimLoop
+ }
+ // Use a backoff approach to reduce demand to the shared memory location
+ // decreases memory contention and allows for other threads to make quicker
+ // progress.
+ // Read more in this Arm blog post:
+ // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
+ nano_delay(backoff)
+ // Increase backoff time.
+ backoff += backoff >> 1
+ headtail = b.index.load()
+ head, tail = headtail.split()
+ }
+ // We failed to claim the spot we were after and the head changed,
+ // meaning a popper got ahead of us. Try again from the top because
+ // the buf may not be empty.
+ }
+ top, bottom := head/spanSetBlockEntries, head%spanSetBlockEntries
+
+ // We may be reading a stale spine pointer, but because the length
+ // grows monotonically and we've already verified it, we'll definitely
+ // be reading from a valid block.
+ blockp := b.spine.Load().lookup(uintptr(top))
+
+ // Given that the spine length is correct, we know we will never
+ // see a nil block here, since the length is always updated after
+ // the block is set.
+ block := blockp.Load()
+ s := block.spans[bottom].Load()
+ for s == nil {
+ // We raced with the span actually being set, but given that we
+ // know a block for this span exists, the race window here is
+ // extremely small. Try again.
+ s = block.spans[bottom].Load()
+ }
+ // Clear the pointer. This isn't strictly necessary, but defensively
+ // avoids accidentally re-using blocks which could lead to memory
+ // corruption. This way, we'll get a nil pointer access instead.
+ block.spans[bottom].StoreNoWB(nil)
+
+ // Increase the popped count. If we are the last possible popper
+ // in the block (note that bottom need not equal spanSetBlockEntries-1
+ // due to races) then it's our responsibility to free the block.
+ //
+ // If we increment popped to spanSetBlockEntries, we can be sure that
+ // we're the last popper for this block, and it's thus safe to free it.
+ // Every other popper must have crossed this barrier (and thus finished
+ // popping its corresponding mspan) by the time we get here. Because
+ // we're the last popper, we also don't have to worry about concurrent
+ // pushers (there can't be any). Note that we may not be the popper
+ // which claimed the last slot in the block, we're just the last one
+ // to finish popping.
+ if block.popped.Add(1) == spanSetBlockEntries {
+ // Clear the block's pointer.
+ blockp.StoreNoWB(nil)
+
+ // Return the block to the block pool.
+ spanSetBlockPool.free(block)
+ }
+ return s
+}
diff --git a/src/runtime/stubs_arm64.go b/src/runtime/stubs_arm64.go
index df04e64..e83c10f 100644
--- a/src/runtime/stubs_arm64.go
+++ b/src/runtime/stubs_arm64.go
@@ -25,3 +25,5 @@
// getfp returns the frame pointer register of its caller or 0 if not implemented.
// TODO: Make this a compiler intrinsic
func getfp() uintptr
+
+func nano_delay(backoff_ns uint32)

Change information

Files:
  • M src/runtime/asm_arm64.s
  • M src/runtime/lfstack.go
  • M src/runtime/mspanset.go
  • A src/runtime/pop.go
  • A src/runtime/pop_arm64.go
  • M src/runtime/stubs_arm64.go
Change size: L
Delta: 6 files changed, 282 insertions(+), 98 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
Gerrit-Change-Number: 654895
Gerrit-PatchSet: 1
Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Fannie Zhang (Gerrit)

unread,
Mar 4, 2025, 9:59:34 PM3/4/25
to goph...@pubsubhelper.golang.org, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Cherry Mui, Ian Lance Taylor, Michael Knyszek and Michael Pratt

Fannie Zhang voted and added 1 comment

Votes added by Fannie Zhang

Run-TryBot+1

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Fannie Zhang . resolved

Can you help to reivew this patch? Thank you.

Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Ian Lance Taylor
  • Michael Knyszek
  • Michael Pratt
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedLegacy-TryBots-Pass
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
    Gerrit-Change-Number: 654895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
    Gerrit-Attention: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Comment-Date: Wed, 05 Mar 2025 02:59:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Mar 4, 2025, 11:07:18 PM3/4/25
    to Fannie Zhang, goph...@pubsubhelper.golang.org, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Fannie Zhang, Michael Knyszek and Michael Pratt

    Ian Lance Taylor added 1 comment

    Patchset-level comments
    Ian Lance Taylor . resolved

    Thanks.

    Is there a reason to think that there is more of a problem on arm64 than other processors? It seems to me likely that we should do the same thing on all processors.

    Rather than nano_sleep (which is misnamed for Go, should be nanoSleep or nsleep), I suggest that we use the existing procyield function. If that function is not a good choice, why not?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Fannie Zhang
    • Michael Knyszek
    • Michael Pratt
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedLegacy-TryBots-Pass
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
      Gerrit-Change-Number: 654895
      Gerrit-PatchSet: 1
      Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Michael Pratt <mpr...@google.com>
      Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Wed, 05 Mar 2025 04:07:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      unsatisfied_requirement
      open
      diffy

      Michael Pratt (Gerrit)

      unread,
      Mar 5, 2025, 10:39:22 AM3/5/25
      to Fannie Zhang, goph...@pubsubhelper.golang.org, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor and Michael Knyszek

      Michael Pratt voted and added 1 comment

      Votes added by Michael Pratt

      Commit-Queue+1

      1 comment

      Patchset-level comments
      Ian Lance Taylor . resolved

      Thanks.

      Is there a reason to think that there is more of a problem on arm64 than other processors? It seems to me likely that we should do the same thing on all processors.

      Rather than nano_sleep (which is misnamed for Go, should be nanoSleep or nsleep), I suggest that we use the existing procyield function. If that function is not a good choice, why not?

      Michael Pratt

      This is not an arm64-specific issue, it is the most common scalability bottleneck we see inside the GC. https://go.dev/issue/21056 is a very old issue. More recently examples like https://go.dev/issue/65064#issuecomment-2609805922 still show this bottleneck (in the second screenshot, the hot function under `runtime.scanstack` is `getempty`).

      We definitely want to improve this. Perhaps backoff is a good/easy first step. Better I think would be redesigns that actually fundamentally reduce contention.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • Fannie Zhang
      • Ian Lance Taylor
      • Michael Knyszek
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedLegacy-TryBots-Pass
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
      Gerrit-Change-Number: 654895
      Gerrit-PatchSet: 1
      Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Wed, 05 Mar 2025 15:39:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
      unsatisfied_requirement
      open
      diffy

      Fannie Zhang (Gerrit)

      unread,
      Mar 5, 2025, 8:39:40 PM3/5/25
      to goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Cherry Mui, Ian Lance Taylor, Michael Knyszek and Michael Pratt

      Fannie Zhang added 1 comment

      Patchset-level comments
      Ian Lance Taylor . resolved

      Thanks.

      Is there a reason to think that there is more of a problem on arm64 than other processors? It seems to me likely that we should do the same thing on all processors.

      Rather than nano_sleep (which is misnamed for Go, should be nanoSleep or nsleep), I suggest that we use the existing procyield function. If that function is not a good choice, why not?

      Fannie Zhang

      I agree that this is not just a problem with the arm64 platform. But I don't have other non-arm64 environments to test the impact of the modification on their performance.

      On arm64, procyield function is implemented with the YIELD instruction, which does not provide a backoff when spinning or waiting. We considered changing the procyield implementation to a nano_sleep implementation, but there are many other places in the runtime that call procyield and we don't know if the new implementation will function differently from the original.

      Do you think it is ok to change the implementation of procyield to that of nano_sleep? Thanks.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • Ian Lance Taylor
      • Michael Knyszek
      • Michael Pratt
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedLegacy-TryBots-Pass
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
        Gerrit-Change-Number: 654895
        Gerrit-PatchSet: 1
        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Cherry Mui <cher...@google.com>
        Gerrit-Comment-Date: Thu, 06 Mar 2025 01:39:33 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Dmitri Shuralyov (Gerrit)

        unread,
        Apr 11, 2025, 7:09:38 PM4/11/25
        to Fannie Zhang, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Cherry Mui, Ian Lance Taylor, Michael Knyszek and Michael Pratt

        Dmitri Shuralyov added 1 comment

        Patchset-level comments
        Gopher Robot . resolved

        TryBots beginning. Status page: https://farmer.golang.org/try?commit=c254c9b8

        Dmitri Shuralyov

        There weren't any specific legacy trybots requested, to stopping this empty request.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Cherry Mui
        • Ian Lance Taylor
        • Michael Knyszek
        • Michael Pratt
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedLegacy-TryBots-Pass
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
          Gerrit-Change-Number: 654895
          Gerrit-PatchSet: 1
          Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
          Gerrit-Reviewer: Cherry Mui <cher...@google.com>
          Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Attention: Michael Pratt <mpr...@google.com>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Cherry Mui <cher...@google.com>
          Gerrit-Comment-Date: Fri, 11 Apr 2025 23:09:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Gopher Robot <go...@golang.org>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Dmitri Shuralyov (Gerrit)

          unread,
          Apr 11, 2025, 7:09:39 PM4/11/25
          to Fannie Zhang, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor, Michael Knyszek and Michael Pratt

          Dmitri Shuralyov removed a vote from this change

          Removed Run-TryBot+1 by Fannie Zhang <Fannie...@arm.com>
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Cherry Mui
          • Fannie Zhang
          • Ian Lance Taylor
          • Michael Knyszek
          • Michael Pratt
            Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: deleteVote
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
              Gerrit-Change-Number: 654895
              Gerrit-PatchSet: 1
              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
              Gerrit-Reviewer: Cherry Mui <cher...@google.com>
              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
              Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
              Gerrit-CC: Gopher Robot <go...@golang.org>
              Gerrit-Attention: Michael Knyszek <mkny...@google.com>
              Gerrit-Attention: Michael Pratt <mpr...@google.com>
              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy

              Fannie Zhang (Gerrit)

              unread,
              Apr 16, 2025, 11:23:26 PM4/16/25
              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
              Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor, Michael Knyszek and Michael Pratt

              Fannie Zhang uploaded new patchset

              Fannie Zhang uploaded patch set #2 to this change.
              Following approvals got outdated and were removed:
              • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Cherry Mui
              • Fannie Zhang
              • Ian Lance Taylor
              • Michael Knyszek
              • Michael Pratt
              Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement is not satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: newpatchset
                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                Gerrit-Change-Number: 654895
                Gerrit-PatchSet: 2
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Fannie Zhang (Gerrit)

                unread,
                Apr 16, 2025, 11:32:01 PM4/16/25
                to goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
                Attention needed from Cherry Mui, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                Fannie Zhang voted and added 2 comments

                Votes added by Fannie Zhang

                Run-TryBot+1

                2 comments

                Patchset-level comments
                Ian Lance Taylor . resolved

                Thanks.

                Is there a reason to think that there is more of a problem on arm64 than other processors? It seems to me likely that we should do the same thing on all processors.

                Rather than nano_sleep (which is misnamed for Go, should be nanoSleep or nsleep), I suggest that we use the existing procyield function. If that function is not a good choice, why not?

                Fannie Zhang

                I agree that this is not just a problem with the arm64 platform. But I don't have other non-arm64 environments to test the impact of the modification on their performance.

                On arm64, procyield function is implemented with the YIELD instruction, which does not provide a backoff when spinning or waiting. We considered changing the procyield implementation to a nano_sleep implementation, but there are many other places in the runtime that call procyield and we don't know if the new implementation will function differently from the original.

                Do you think it is ok to change the implementation of procyield to that of nano_sleep? Thanks.

                Fannie Zhang

                @ia...@golang.org Kindly ping.

                File-level comment, Patchset 1:
                Fannie Zhang . resolved

                @ia...@google.com The patch was refactored, the patch abandoned nano_delay and rewritten the procyield. Please help to review this patch again. Thank you.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Cherry Mui
                • Ian Lance Taylor
                • Michael Knyszek
                • Michael Pratt
                  Submit Requirements:
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedLegacy-TryBots-Pass
                    • requirement satisfiedNo-Unresolved-Comments
                    • requirement is not satisfiedReview-Enforcement
                    • requirement is not satisfiedTryBots-Pass
                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                    Gerrit-MessageType: comment
                    Gerrit-Project: go
                    Gerrit-Branch: master
                    Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                    Gerrit-Change-Number: 654895
                    Gerrit-PatchSet: 2
                    Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                    Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                    Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
                    Gerrit-CC: Gopher Robot <go...@golang.org>
                    Gerrit-CC: Ian Lance Taylor <ia...@google.com>
                    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                    Gerrit-Attention: Michael Pratt <mpr...@google.com>
                    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                    Gerrit-Comment-Date: Thu, 17 Apr 2025 03:31:51 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
                    Comment-In-Reply-To: Fannie Zhang <Fannie...@arm.com>
                    unsatisfied_requirement
                    satisfied_requirement
                    open
                    diffy

                    Dmitri Shuralyov (Gerrit)

                    unread,
                    Apr 17, 2025, 1:38:17 PM4/17/25
                    to Fannie Zhang, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Michael Knyszek, Gopher Robot, golang-co...@googlegroups.com
                    Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                    Dmitri Shuralyov removed a vote from this change

                    Removed Run-TryBot+1 by Fannie Zhang <Fannie...@arm.com>
                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Cherry Mui
                    • Fannie Zhang
                    • Ian Lance Taylor
                    • Michael Knyszek
                    • Michael Pratt
                      Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: deleteVote
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 2
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-CC: Ian Lance Taylor <ia...@google.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        unsatisfied_requirement
                        open
                        diffy

                        Michael Knyszek (Gerrit)

                        unread,
                        Sep 23, 2025, 5:10:30 PM9/23/25
                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor and Michael Pratt

                        Michael Knyszek added 1 comment

                        Patchset-level comments
                        File-level comment, Patchset 2 (Latest):
                        Michael Knyszek . resolved

                        sorry for not looking at this sooner, but we've been trying to address some of these issues with Green Tea instead. that being said, we still use the old workbufs for larger objects, so something like may still be worthwhile.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Cherry Mui
                        • Fannie Zhang
                        • Ian Lance Taylor
                        • Michael Pratt
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 2
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-CC: Ian Lance Taylor <ia...@google.com>
                        Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Attention: Cherry Mui <cher...@google.com>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                        Gerrit-Comment-Date: Tue, 23 Sep 2025 21:10:26 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        unsatisfied_requirement
                        open
                        diffy

                        Michael Knyszek (Gerrit)

                        unread,
                        Sep 23, 2025, 5:20:12 PM9/23/25
                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Michael Pratt, Cherry Mui, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Cherry Mui, Fannie Zhang, Ian Lance Taylor and Michael Pratt

                        Michael Knyszek voted and added 2 comments

                        Votes added by Michael Knyszek

                        Commit-Queue+1

                        2 comments

                        File src/runtime/asm_arm64.s
                        Line 968, Patchset 2 (Latest):// Armv8.7-A introduced the WFET (FEAT_WFxT) instruction, which allows the

                        // processor to enter a low power state for a set time, or until an event is
                        // received.
                        Michael Knyszek . unresolved

                        what's the reason we're not using it here? would it require an extra feature check? since we're not using it but aware of it (and it's recommended), we should document why.

                        File src/runtime/lfstack.go
                        Line 38, Patchset 2 (Latest): // Use a backoff approach to reduce demand to the shared memory location

                        // decreases memory contention and allows for other threads to make quicker
                        // progress.

                        // Read more in this Arm blog post:
                        // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                        procyield(backoff)
                        // Increase backoff time.
                        backoff += backoff >> 1
                        Michael Knyszek . unresolved

                        the idea that we should back off instead of spinning honestly doesn't seem to be that arm64 specific.

                        I argue that we should make the initial value of backoff dependent on the platform. maybe to start with, we can set it to be zero on all platforms except arm64? and skip the procyield if it's zero? that seems a little bit more general.

                        lastly, we should add a TODO to tweak this number on other platforms besides arm64.

                        Gerrit-Comment-Date: Tue, 23 Sep 2025 21:20:07 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: Yes
                        unsatisfied_requirement
                        open
                        diffy

                        Michael Knyszek (Gerrit)

                        unread,
                        Sep 23, 2025, 5:23:26 PM9/23/25
                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Fannie Zhang, Michael Knyszek and Michael Pratt

                        Michael Knyszek voted and added 1 comment

                        Votes added by Michael Knyszek

                        Commit-Queue+1

                        1 comment

                        Patchset-level comments
                        Michael Knyszek . unresolved

                        ah, your change needs to be rebased on tip. it should be a clean rebase, AFAICT.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Fannie Zhang
                        • Michael Knyszek
                        • Michael Pratt
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 2
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Comment-Date: Tue, 23 Sep 2025 21:23:23 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: Yes
                        unsatisfied_requirement
                        open
                        diffy

                        Michael Pratt (Gerrit)

                        unread,
                        Sep 24, 2025, 2:54:45 PM9/24/25
                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Fannie Zhang and Michael Knyszek

                        Michael Pratt added 9 comments

                        Commit Message
                        Line 9, Patchset 2 (Latest):When profiling CPU usage LiveKit on AArch64/x86 (AWS), the graphs show
                        Michael Pratt . resolved

                        Since you seem to have a benchmark or production workload to measure, we would appreciate any results you can share on https://go.dev/issue/73581 on the impact of the Green Tea GC. Particularly after CL 700496 (which is only on tip, not in 1.25).

                        Line 22, Patchset 2 (Latest):This patch rewrites the implementation of procyiely(), which is an Armv8.0-A
                        Michael Pratt . unresolved

                        procyield

                        File src/runtime/asm_arm64.s
                        Line 973, Patchset 2 (Latest):// the counter-timer. Note that we do not depend on the latency of the ISB instruction.
                        Michael Pratt . unresolved

                        I think what you mean here is that we use a real counter to measure the delay rather than assuming a fixed delay from ISB, but out of context this sentence is confusing because the code below does hard-code an assumed 18ns ISB delay. Please expand the comment to clarify.

                        Line 980, Patchset 2 (Latest): CMP $0x12, R0
                        Michael Pratt . unresolved

                        These constants (and 0x28 below) should probably be in decimal to match the blog post.

                        Line 980, Patchset 2 (Latest): CMP $0x12, R0
                        Michael Pratt . unresolved

                        How much do the heuristics around avoiding ISB for small n, and avoiding ISB at the end of a longer delay actually matter?

                        The smallest input we currently pass is 128ns, so we'll never skip ISB entirely, but will use the heuristic for the last ISB.

                        It seems to me like it shouldn't matter much, especially the tail case. The delay time is already an arbitrary heuristic, so making this function very accurate doesn't seem too important.

                        If we could simplify this function to just the ns -> cycle conversion plus the `delay` loop it would be much easier to reason about.

                        Line 984, Patchset 2 (Latest): ADD R0<<4, R0, R0
                        Michael Pratt . unresolved

                        Shouldn't this be `R0>>4`?

                        Line 978, Patchset 2 (Latest): MOVWU backoff_ns+0(FP), R0
                        ISB $15
                        CMP $0x12, R0
                        BLS ret
                        SUB $0x12, R0, R0
                        MRS CNTFRQ_EL0, R1

                        ADD R0<<4, R0, R0
                        MUL R1, R0, R0
                        LSR $30, R0, R0
                        CBZ R0, ret
                        MRS CNTVCT_EL0, R2
                        CMP $0x28, R0
                        BLS loop
                        SUB $0x28, R0, R3
                        delay:
                        ISB $15
                        MRS CNTVCT_EL0, R1
                        SUB R2, R1, R1
                        CMP R3, R1
                        BCC delay
                        loop:
                        MRS CNTVCT_EL0, R1
                        SUB R2, R1, R1
                        CMP R0, R1
                        BCC loop
                        ret:
                        RET
                        Michael Pratt . unresolved

                        Please add comments throughout to explain what is going on. The blog post provides psuedocode, but if the blog post disappears this code will be quite confusing on its own, particularly because it contains several heuristics.

                        File src/runtime/lfstack.go
                        Line 37, Patchset 2 (Latest): if goarch.IsArm64 == 1 {
                        Michael Pratt . unresolved
                        ```suggestion
                        if GOARCH == "arm64" {
                        ```

                        Comparing the GOARCH is the preferred form outside of constants that must use a number.

                        Line 45, Patchset 2 (Latest): backoff += backoff >> 1
                        Michael Pratt . resolved

                        In my opinion, division is more intuitive.

                        ```suggestion
                        backoff += backoff / 2
                        ```
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Fannie Zhang
                        • Michael Knyszek
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 2
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Comment-Date: Wed, 24 Sep 2025 18:54:40 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        unsatisfied_requirement
                        open
                        diffy

                        Ian Lance Taylor (Gerrit)

                        unread,
                        Sep 24, 2025, 3:12:26 PM9/24/25
                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Fannie Zhang and Michael Knyszek

                        Ian Lance Taylor added 2 comments

                        Commit Message
                        Line 7, Patchset 2 (Latest):runtime: reduce contention in (*lfstack).pop
                        Ian Lance Taylor . unresolved

                        "on arm64"

                        File src/runtime/lfstack.go
                        Line 25, Patchset 2 (Latest):func (head *lfstack) pop() unsafe.Pointer {
                        Ian Lance Taylor . unresolved

                        Why is pop moving from where it was? It seems like the current location below push is the logical one.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Fannie Zhang
                        • Michael Knyszek
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 2
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Comment-Date: Wed, 24 Sep 2025 19:12:20 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        unsatisfied_requirement
                        open
                        diffy

                        Fannie Zhang (Gerrit)

                        unread,
                        Oct 8, 2025, 11:34:00 PM10/8/25
                        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                        Attention needed from Fannie Zhang and Michael Knyszek

                        Fannie Zhang uploaded new patchset

                        Fannie Zhang uploaded patch set #4 to this change.
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Fannie Zhang
                        • Michael Knyszek
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: newpatchset
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 4
                        unsatisfied_requirement
                        open
                        diffy

                        Fannie Zhang (Gerrit)

                        unread,
                        Oct 8, 2025, 11:42:25 PM10/8/25
                        to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Ian Lance Taylor, Michael Knyszek and Michael Pratt

                        Fannie Zhang added 8 comments

                        Patchset-level comments
                        File-level comment, Patchset 2:
                        Michael Knyszek . resolved

                        ah, your change needs to be rebased on tip. it should be a clean rebase, AFAICT.

                        Fannie Zhang

                        Done

                        File-level comment, Patchset 3:
                        Fannie Zhang . resolved

                        I just got back from the National Day holiday, so my reply is late. Thank you for the review. I've already resolved some of the comments and am still working on it. Thanks again.

                        Commit Message
                        Line 7, Patchset 2:runtime: reduce contention in (*lfstack).pop
                        Ian Lance Taylor . resolved

                        "on arm64"

                        Fannie Zhang

                        Done

                        Line 22, Patchset 2:This patch rewrites the implementation of procyiely(), which is an Armv8.0-A
                        Michael Pratt . resolved

                        procyield

                        Fannie Zhang

                        Done

                        File src/runtime/asm_arm64.s
                        Line 968, Patchset 2:// Armv8.7-A introduced the WFET (FEAT_WFxT) instruction, which allows the

                        // processor to enter a low power state for a set time, or until an event is
                        // received.
                        Michael Knyszek . resolved

                        what's the reason we're not using it here? would it require an extra feature check? since we're not using it but aware of it (and it's recommended), we should document why.

                        Fannie Zhang

                        Done

                        File src/runtime/lfstack.go
                        Line 25, Patchset 2:func (head *lfstack) pop() unsafe.Pointer {
                        Ian Lance Taylor . unresolved

                        Why is pop moving from where it was? It seems like the current location below push is the logical one.

                        Fannie Zhang

                        It was a mistake. Moved it back to its original location. Done.

                        Line 37, Patchset 2: if goarch.IsArm64 == 1 {
                        Michael Pratt . resolved
                        ```suggestion
                        if GOARCH == "arm64" {
                        ```

                        Comparing the GOARCH is the preferred form outside of constants that must use a number.

                        Fannie Zhang

                        Done

                        Line 45, Patchset 2: backoff += backoff >> 1
                        Michael Pratt . resolved

                        In my opinion, division is more intuitive.

                        ```suggestion
                        backoff += backoff / 2
                        ```
                        Fannie Zhang

                        Done

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Ian Lance Taylor
                        • Michael Knyszek
                        • Michael Pratt
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 3
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Comment-Date: Thu, 09 Oct 2025 03:42:16 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
                        Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
                        Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                        unsatisfied_requirement
                        open
                        diffy

                        Fannie Zhang (Gerrit)

                        unread,
                        Oct 9, 2025, 5:15:52 AM10/9/25
                        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                        Attention needed from Ian Lance Taylor, Michael Knyszek and Michael Pratt

                        Fannie Zhang uploaded new patchset

                        Fannie Zhang uploaded patch set #5 to this change.
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Ian Lance Taylor
                        • Michael Knyszek
                        • Michael Pratt
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: newpatchset
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 5
                        unsatisfied_requirement
                        open
                        diffy

                        Fannie Zhang (Gerrit)

                        unread,
                        Oct 9, 2025, 5:16:02 AM10/9/25
                        to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Ian Lance Taylor, Michael Knyszek and Michael Pratt

                        Fannie Zhang added 4 comments

                        File src/runtime/asm_arm64.s
                        Line 980, Patchset 2: CMP $0x12, R0
                        Michael Pratt . resolved

                        These constants (and 0x28 below) should probably be in decimal to match the blog post.

                        Fannie Zhang

                        Done

                        Line 980, Patchset 2: CMP $0x12, R0
                        Michael Pratt . resolved

                        How much do the heuristics around avoiding ISB for small n, and avoiding ISB at the end of a longer delay actually matter?

                        The smallest input we currently pass is 128ns, so we'll never skip ISB entirely, but will use the heuristic for the last ISB.

                        It seems to me like it shouldn't matter much, especially the tail case. The delay time is already an arbitrary heuristic, so making this function very accurate doesn't seem too important.

                        If we could simplify this function to just the ns -> cycle conversion plus the `delay` loop it would be much easier to reason about.

                        Fannie Zhang

                        Done

                        Line 984, Patchset 2: ADD R0<<4, R0, R0
                        Michael Pratt . resolved

                        Shouldn't this be `R0>>4`?

                        Fannie Zhang

                        Done

                        Line 978, Patchset 2: MOVWU backoff_ns+0(FP), R0
                        Michael Pratt . resolved

                        Please add comments throughout to explain what is going on. The blog post provides psuedocode, but if the blog post disappears this code will be quite confusing on its own, particularly because it contains several heuristics.

                        Fannie Zhang

                        Done

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Ian Lance Taylor
                        • Michael Knyszek
                        • Michael Pratt
                        Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                        Gerrit-Change-Number: 654895
                        Gerrit-PatchSet: 4
                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                        Gerrit-CC: Gopher Robot <go...@golang.org>
                        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                        Gerrit-Comment-Date: Thu, 09 Oct 2025 09:15:56 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
                        unsatisfied_requirement
                        open
                        diffy

                        Fannie Zhang (Gerrit)

                        unread,
                        Oct 9, 2025, 5:37:29 AM10/9/25
                        to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                        Attention needed from Ian Lance Taylor, Michael Knyszek and Michael Pratt

                        Fannie Zhang voted Run-TryBot+1

                        Run-TryBot+1
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Ian Lance Taylor
                        • Michael Knyszek
                        • Michael Pratt
                        Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedLegacy-TryBots-Pass
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                          Gerrit-Change-Number: 654895
                          Gerrit-PatchSet: 5
                          Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                          Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Michael Pratt <mpr...@google.com>
                          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                          Gerrit-Comment-Date: Thu, 09 Oct 2025 09:37:22 +0000
                          Gerrit-HasComments: No
                          Gerrit-Has-Labels: Yes
                          unsatisfied_requirement
                          open
                          diffy

                          Michael Knyszek (Gerrit)

                          unread,
                          Oct 9, 2025, 8:37:28 AM10/9/25
                          to Fannie Zhang, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                          Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                          Michael Knyszek voted Commit-Queue+1

                          Commit-Queue+1
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Fannie Zhang
                          • Ian Lance Taylor
                          • Michael Pratt
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedLegacy-TryBots-Pass
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                          Gerrit-Change-Number: 654895
                          Gerrit-PatchSet: 5
                          Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                          Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Michael Pratt <mpr...@google.com>
                          Gerrit-Comment-Date: Thu, 09 Oct 2025 12:37:22 +0000
                          Gerrit-HasComments: No
                          Gerrit-Has-Labels: Yes
                          unsatisfied_requirement
                          open
                          diffy

                          Michael Knyszek (Gerrit)

                          unread,
                          Oct 9, 2025, 8:37:35 AM10/9/25
                          to Fannie Zhang, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                          Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                          Michael Knyszek added 1 comment

                          Patchset-level comments
                          File-level comment, Patchset 5 (Latest):
                          Gopher Robot . resolved

                          TryBots beginning. Status page: https://farmer.golang.org/try?commit=1b38e926

                          Michael Knyszek

                          Acknowledged

                          Gerrit-Comment-Date: Thu, 09 Oct 2025 12:37:32 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Comment-In-Reply-To: Gopher Robot <go...@golang.org>
                          unsatisfied_requirement
                          open
                          diffy

                          Michael Knyszek (Gerrit)

                          unread,
                          Oct 9, 2025, 8:37:52 AM10/9/25
                          to Fannie Zhang, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Go LUCI, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                          Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                          Michael Knyszek removed a vote from this change

                          Removed Run-TryBot+1 by Fannie Zhang <Fannie...@arm.com>

                          Related details

                          Attention is currently required from:
                          • Fannie Zhang
                          • Ian Lance Taylor
                          • Michael Pratt
                          Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: deleteVote
                            unsatisfied_requirement
                            open
                            diffy

                            Fannie Zhang (Gerrit)

                            unread,
                            Oct 9, 2025, 11:31:56 PM10/9/25
                            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                            Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                            Fannie Zhang uploaded new patchset

                            Fannie Zhang uploaded patch set #6 to this change.
                            Following approvals got outdated and were removed:
                            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Fannie Zhang
                            • Ian Lance Taylor
                            • Michael Pratt
                            Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: newpatchset
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                            Gerrit-Change-Number: 654895
                            Gerrit-PatchSet: 6
                            unsatisfied_requirement
                            open
                            diffy

                            Fannie Zhang (Gerrit)

                            unread,
                            Oct 9, 2025, 11:33:53 PM10/9/25
                            to goph...@pubsubhelper.golang.org, Go LUCI, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Ian Lance Taylor and Michael Pratt

                            Fannie Zhang added 3 comments

                            Patchset-level comments
                            File-level comment, Patchset 6 (Latest):
                            Fannie Zhang . resolved

                            All done. Please help to review it, thanks.

                            Commit Message
                            Line 9, Patchset 2:When profiling CPU usage LiveKit on AArch64/x86 (AWS), the graphs show
                            Michael Pratt . resolved

                            Since you seem to have a benchmark or production workload to measure, we would appreciate any results you can share on https://go.dev/issue/73581 on the impact of the Green Tea GC. Particularly after CL 700496 (which is only on tip, not in 1.25).

                            Fannie Zhang

                            I am working on it. Will update results later.

                            File src/runtime/asm_arm64.s
                            Line 973, Patchset 2:// the counter-timer. Note that we do not depend on the latency of the ISB instruction.
                            Michael Pratt . resolved

                            I think what you mean here is that we use a real counter to measure the delay rather than assuming a fixed delay from ISB, but out of context this sentence is confusing because the code below does hard-code an assumed 18ns ISB delay. Please expand the comment to clarify.

                            Fannie Zhang

                            Done

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Ian Lance Taylor
                            • Michael Pratt
                            Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: comment
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                            Gerrit-Change-Number: 654895
                            Gerrit-PatchSet: 6
                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                            Gerrit-CC: Gopher Robot <go...@golang.org>
                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                            Gerrit-Comment-Date: Fri, 10 Oct 2025 03:33:45 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
                            unsatisfied_requirement
                            open
                            diffy

                            Fannie Zhang (Gerrit)

                            unread,
                            Oct 10, 2025, 2:38:14 AM10/10/25
                            to goph...@pubsubhelper.golang.org, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Ian Lance Taylor, Michael Knyszek and Michael Pratt

                            Fannie Zhang added 2 comments

                            File src/runtime/lfstack.go
                            Line 25, Patchset 2:func (head *lfstack) pop() unsafe.Pointer {
                            Ian Lance Taylor . resolved

                            Why is pop moving from where it was? It seems like the current location below push is the logical one.

                            Fannie Zhang

                            It was a mistake. Moved it back to its original location. Done.

                            Fannie Zhang

                            Done

                            Line 38, Patchset 2: // Use a backoff approach to reduce demand to the shared memory location

                            // decreases memory contention and allows for other threads to make quicker
                            // progress.
                            // Read more in this Arm blog post:
                            // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                            procyield(backoff)
                            // Increase backoff time.
                            backoff += backoff >> 1
                            Michael Knyszek . unresolved

                            the idea that we should back off instead of spinning honestly doesn't seem to be that arm64 specific.

                            I argue that we should make the initial value of backoff dependent on the platform. maybe to start with, we can set it to be zero on all platforms except arm64? and skip the procyield if it's zero? that seems a little bit more general.

                            lastly, we should add a TODO to tweak this number on other platforms besides arm64.

                            Fannie Zhang

                            Do you mean the modification as below:

                            ```
                            var backoff uint32 = 0
                            if GOARCH == "arm64" {
                            backoff = 128
                            }
                            ...
                            procyield(backoff)

                            backoff += backoff / 2
                            ```
                            However, based on this modification, the behavior on other architectures may change. On amd64, the procyield is implemented as follows, which runs PAUSE for delay even if the value of cycles is 0.
                            ```
                            TEXT runtime·procyield(SB),NOSPLIT,$0-0
                            MOVL cycles+0(FP), AX
                            again:
                            PAUSE
                            SUBL $1, AX
                            JNZ again
                            RET
                            ```

                            If I miss something please correct me. Thanks.

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Ian Lance Taylor
                            • Michael Knyszek
                            • Michael Pratt
                            Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: comment
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                            Gerrit-Change-Number: 654895
                            Gerrit-PatchSet: 6
                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                            Gerrit-CC: Gopher Robot <go...@golang.org>
                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                            Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                            Gerrit-Comment-Date: Fri, 10 Oct 2025 06:38:06 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Fannie Zhang <Fannie...@arm.com>
                            Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
                            Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                            unsatisfied_requirement
                            open
                            diffy

                            Emmanuel Odeke (Gerrit)

                            unread,
                            Oct 10, 2025, 5:27:09 AM10/10/25
                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Fannie Zhang, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                            Emmanuel Odeke added 3 comments

                            Patchset-level comments
                            Emmanuel Odeke . resolved

                            Nice work and thank you Fannie. Backoff is a great remedy even for reducing
                            contention of even high level processes. However, without jitter (randomization of a couple of units of time) every single contenting process will retry with the
                            exact same backoff which can then cause more contention in lockstep, hence I suggest that we add some jitter randomized and bounded, for every single retry.

                            Commit Message
                            Line 6, Patchset 6 (Latest):
                            Emmanuel Odeke . unresolved

                            Perhaps can we add to the subject “using backoff and ISB instruction”

                            File src/runtime/mspanset.go
                            Line 189, Patchset 6 (Latest): backoff += backoff >> 1
                            Emmanuel Odeke . unresolved

                            This backoff jitter (randomization of a few nanoseconds) of which that is to prevent lockstep retries if all similar processes retry at the exact same time, to help further reduce the contention. With the current code, every one of the contending processes will repeat with the same backoff like this:

                            n=1; backoff is 128 + 128/2 =192
                            n=2; backoff is 192 + 192/2 =288
                            n=3; backoff is 288 + 288/2 =432

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Fannie Zhang
                            • Ian Lance Taylor
                            • Michael Knyszek
                            • Michael Pratt
                            Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: comment
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                            Gerrit-Change-Number: 654895
                            Gerrit-PatchSet: 6
                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                            Gerrit-CC: Gopher Robot <go...@golang.org>
                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                            Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                            Gerrit-Comment-Date: Fri, 10 Oct 2025 09:27:00 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            unsatisfied_requirement
                            open
                            diffy

                            Michael Knyszek (Gerrit)

                            unread,
                            Oct 10, 2025, 12:40:44 PM10/10/25
                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                            Michael Knyszek added 1 comment

                            File src/runtime/mspanset.go
                            Line 189, Patchset 6 (Latest): backoff += backoff >> 1
                            Emmanuel Odeke . unresolved

                            This backoff jitter (randomization of a few nanoseconds) of which that is to prevent lockstep retries if all similar processes retry at the exact same time, to help further reduce the contention. With the current code, every one of the contending processes will repeat with the same backoff like this:

                            n=1; backoff is 128 + 128/2 =192
                            n=2; backoff is 192 + 192/2 =288
                            n=3; backoff is 288 + 288/2 =432

                            Michael Knyszek

                            at the scale of a couple hundred nanoseconds of backoff, computing a pseudorandom jitter might be more trouble than it's worth. the longer you take to decide how to wait, the more time you're spending burning CPU time instead of getting into that low power state. there's also likely some amount of jitter in the form of the current state of the CPU -- procyield is not going to execute in the same amount of cycles every single time.

                            I'm not sure what the trade-off is, but I don't think we need to complicate the assembly unless we see a real issue or a real improvement from adding jitter. (so, maybe worth trying, but IMO this shouldn't be a blocker.)

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Fannie Zhang
                            • Ian Lance Taylor
                            • Michael Pratt
                            Gerrit-Comment-Date: Fri, 10 Oct 2025 16:40:39 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
                            unsatisfied_requirement
                            open
                            diffy

                            Michael Knyszek (Gerrit)

                            unread,
                            Oct 10, 2025, 12:43:26 PM10/10/25
                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                            Michael Knyszek added 1 comment

                            File src/runtime/lfstack.go
                            Michael Knyszek

                            yeah, that's pretty much what I meant.

                            I think it's OK to change the behavior slightly on other platforms. we see contention problems there, too. might just be worth mentioning in the commit message.

                            Gerrit-Comment-Date: Fri, 10 Oct 2025 16:43:21 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Fannie Zhang <Fannie...@arm.com>
                            Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                            unsatisfied_requirement
                            open
                            diffy

                            Fannie Zhang (Gerrit)

                            unread,
                            Oct 13, 2025, 1:57:38 AM10/13/25
                            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                            Attention needed from Fannie Zhang, Ian Lance Taylor and Michael Pratt

                            Fannie Zhang uploaded new patchset

                            Fannie Zhang uploaded patch set #7 to this change.
                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Fannie Zhang
                            • Ian Lance Taylor
                            • Michael Pratt
                            Submit Requirements:
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            • requirement is not satisfiedReview-Enforcement
                            • requirement is not satisfiedTryBots-Pass
                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                            Gerrit-MessageType: newpatchset
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                            Gerrit-Change-Number: 654895
                            Gerrit-PatchSet: 7
                            unsatisfied_requirement
                            open
                            diffy

                            Fannie Zhang (Gerrit)

                            unread,
                            Oct 13, 2025, 2:12:53 AM10/13/25
                            to goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                            Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                            Fannie Zhang added 4 comments

                            Patchset-level comments
                            Emmanuel Odeke . resolved

                            Nice work and thank you Fannie. Backoff is a great remedy even for reducing
                            contention of even high level processes. However, without jitter (randomization of a couple of units of time) every single contenting process will retry with the
                            exact same backoff which can then cause more contention in lockstep, hence I suggest that we add some jitter randomized and bounded, for every single retry.

                            Fannie Zhang

                            Thanks for the suggestion. I agree with Michael Knyszek's idea and don't want to make the implementation too complicated.

                            Commit Message
                            Line 6, Patchset 6:
                            Emmanuel Odeke . resolved

                            Perhaps can we add to the subject “using backoff and ISB instruction”

                            Fannie Zhang

                            Done

                            File src/runtime/lfstack.go
                            Line 38, Patchset 2: // Use a backoff approach to reduce demand to the shared memory location
                            // decreases memory contention and allows for other threads to make quicker
                            // progress.
                            // Read more in this Arm blog post:
                            // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                            procyield(backoff)
                            // Increase backoff time.
                            backoff += backoff >> 1
                            Michael Knyszek . resolved

                            the idea that we should back off instead of spinning honestly doesn't seem to be that arm64 specific.

                            I argue that we should make the initial value of backoff dependent on the platform. maybe to start with, we can set it to be zero on all platforms except arm64? and skip the procyield if it's zero? that seems a little bit more general.

                            lastly, we should add a TODO to tweak this number on other platforms besides arm64.

                            Fannie Zhang

                            Do you mean the modification as below:

                            ```
                            var backoff uint32 = 0
                            if GOARCH == "arm64" {
                            backoff = 128
                            }
                            ...
                            procyield(backoff)
                            backoff += backoff / 2
                            ```
                            However, based on this modification, the behavior on other architectures may change. On amd64, the procyield is implemented as follows, which runs PAUSE for delay even if the value of cycles is 0.
                            ```
                            TEXT runtime·procyield(SB),NOSPLIT,$0-0
                            MOVL cycles+0(FP), AX
                            again:
                            PAUSE
                            SUBL $1, AX
                            JNZ again
                            RET
                            ```

                            If I miss something please correct me. Thanks.

                            Michael Knyszek

                            yeah, that's pretty much what I meant.

                            I think it's OK to change the behavior slightly on other platforms. we see contention problems there, too. might just be worth mentioning in the commit message.

                            Fannie Zhang

                            Got it. Done. Thanks.

                            File src/runtime/mspanset.go
                            Line 189, Patchset 6: backoff += backoff >> 1
                            Emmanuel Odeke . resolved

                            This backoff jitter (randomization of a few nanoseconds) of which that is to prevent lockstep retries if all similar processes retry at the exact same time, to help further reduce the contention. With the current code, every one of the contending processes will repeat with the same backoff like this:

                            n=1; backoff is 128 + 128/2 =192
                            n=2; backoff is 192 + 192/2 =288
                            n=3; backoff is 288 + 288/2 =432

                            Michael Knyszek

                            at the scale of a couple hundred nanoseconds of backoff, computing a pseudorandom jitter might be more trouble than it's worth. the longer you take to decide how to wait, the more time you're spending burning CPU time instead of getting into that low power state. there's also likely some amount of jitter in the form of the current state of the CPU -- procyield is not going to execute in the same amount of cycles every single time.

                            I'm not sure what the trade-off is, but I don't think we need to complicate the assembly unless we see a real issue or a real improvement from adding jitter. (so, maybe worth trying, but IMO this shouldn't be a blocker.)

                            Fannie Zhang

                            Acknowledged

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Emmanuel Odeke
                            • Ian Lance Taylor
                            • Michael Knyszek
                            • Michael Pratt
                            Submit Requirements:
                              • requirement is not satisfiedCode-Review
                              • requirement satisfiedNo-Unresolved-Comments
                              • requirement is not satisfiedReview-Enforcement
                              • requirement is not satisfiedTryBots-Pass
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: comment
                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                              Gerrit-Change-Number: 654895
                              Gerrit-PatchSet: 6
                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-CC: Gopher Robot <go...@golang.org>
                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Michael Pratt <mpr...@google.com>
                              Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                              Gerrit-Comment-Date: Mon, 13 Oct 2025 06:12:43 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Fannie Zhang (Gerrit)

                              unread,
                              Oct 14, 2025, 2:26:10 AM10/14/25
                              to goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                              Fannie Zhang added 1 comment

                              Patchset-level comments
                              Emmanuel Odeke . resolved

                              Nice work and thank you Fannie. Backoff is a great remedy even for reducing
                              contention of even high level processes. However, without jitter (randomization of a couple of units of time) every single contenting process will retry with the
                              exact same backoff which can then cause more contention in lockstep, hence I suggest that we add some jitter randomized and bounded, for every single retry.

                              Fannie Zhang

                              Thanks for the suggestion. I agree with Michael Knyszek's idea and don't want to make the implementation too complicated.

                              Fannie Zhang

                              And it seems orthogonal to our backoff solution. It could be implemented afterwards in a separate commit. But first such a randomization feature needs to be benchmarked and its actual benefits measured. Thanks.

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Emmanuel Odeke
                              • Ian Lance Taylor
                              • Michael Knyszek
                              • Michael Pratt
                              Submit Requirements:
                              • requirement is not satisfiedCode-Review
                              • requirement satisfiedNo-Unresolved-Comments
                              • requirement is not satisfiedReview-Enforcement
                              • requirement is not satisfiedTryBots-Pass
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: comment
                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                              Gerrit-Change-Number: 654895
                              Gerrit-PatchSet: 7
                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-CC: Gopher Robot <go...@golang.org>
                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Michael Pratt <mpr...@google.com>
                              Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                              Gerrit-Comment-Date: Tue, 14 Oct 2025 06:26:00 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              Comment-In-Reply-To: Fannie Zhang <Fannie...@arm.com>
                              Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Michael Knyszek (Gerrit)

                              unread,
                              Oct 14, 2025, 1:23:20 PM10/14/25
                              to Fannie Zhang, goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                              Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and Michael Pratt

                              Michael Knyszek added 2 comments

                              Patchset-level comments
                              File-level comment, Patchset 7 (Latest):
                              Michael Knyszek . resolved

                              looks good overall -- one more comment for consistency, but that's all I've got. thank you!

                              File src/runtime/mspanset.go
                              Line 181, Patchset 7 (Latest): if goarch.IsArm64 == 1 {

                              // Use a backoff approach to reduce demand to the shared memory location
                              // decreases memory contention and allows for other threads to make quicker
                              // progress.
                              // Read more in this Arm blog post:
                              // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                              procyield(backoff)
                              // Increase backoff time.
                              backoff += backoff >> 1
                              }
                              Michael Knyszek . unresolved

                              could you please also make this platform agnostic in the same way you did for lfstack?

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Emmanuel Odeke
                              • Fannie Zhang
                              • Ian Lance Taylor
                              • Michael Pratt
                              Submit Requirements:
                                • requirement is not satisfiedCode-Review
                                • requirement is not satisfiedNo-Unresolved-Comments
                                • requirement is not satisfiedReview-Enforcement
                                • requirement is not satisfiedTryBots-Pass
                                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                Gerrit-MessageType: comment
                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                Gerrit-Change-Number: 654895
                                Gerrit-PatchSet: 7
                                Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                Gerrit-CC: Gopher Robot <go...@golang.org>
                                Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                Gerrit-Comment-Date: Tue, 14 Oct 2025 17:23:14 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: No
                                unsatisfied_requirement
                                open
                                diffy

                                Fannie Zhang (Gerrit)

                                unread,
                                Oct 15, 2025, 4:48:29 AM10/15/25
                                to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and Michael Pratt

                                Fannie Zhang uploaded new patchset

                                Fannie Zhang uploaded patch set #8 to this change.
                                Open in Gerrit

                                Related details

                                Attention is currently required from:
                                • Emmanuel Odeke
                                • Fannie Zhang
                                • Ian Lance Taylor
                                • Michael Pratt
                                Submit Requirements:
                                • requirement is not satisfiedCode-Review
                                • requirement is not satisfiedNo-Unresolved-Comments
                                • requirement is not satisfiedReview-Enforcement
                                • requirement is not satisfiedTryBots-Pass
                                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                Gerrit-MessageType: newpatchset
                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                Gerrit-Change-Number: 654895
                                Gerrit-PatchSet: 8
                                unsatisfied_requirement
                                open
                                diffy

                                Fannie Zhang (Gerrit)

                                unread,
                                Oct 15, 2025, 4:48:39 AM10/15/25
                                to goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                                Fannie Zhang voted and added 1 comment

                                Votes added by Fannie Zhang

                                Run-TryBot+1

                                1 comment

                                File src/runtime/mspanset.go
                                Line 181, Patchset 7: if goarch.IsArm64 == 1 {

                                // Use a backoff approach to reduce demand to the shared memory location
                                // decreases memory contention and allows for other threads to make quicker
                                // progress.
                                // Read more in this Arm blog post:
                                // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                                procyield(backoff)
                                // Increase backoff time.
                                backoff += backoff >> 1
                                }
                                Michael Knyszek . unresolved

                                could you please also make this platform agnostic in the same way you did for lfstack?

                                Fannie Zhang

                                Of course, I forgot to update it. Thanks.

                                Open in Gerrit

                                Related details

                                Attention is currently required from:
                                • Emmanuel Odeke
                                • Ian Lance Taylor
                                • Michael Knyszek
                                • Michael Pratt
                                Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not satisfiedLegacy-TryBots-Pass
                                  • requirement is not satisfiedNo-Unresolved-Comments
                                  • requirement is not satisfiedReview-Enforcement
                                  • requirement is not satisfiedTryBots-Pass
                                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                  Gerrit-MessageType: comment
                                  Gerrit-Project: go
                                  Gerrit-Branch: master
                                  Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                  Gerrit-Change-Number: 654895
                                  Gerrit-PatchSet: 8
                                  Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                  Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                  Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                  Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                  Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                  Gerrit-CC: Gopher Robot <go...@golang.org>
                                  Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                  Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                  Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                  Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                  Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                  Gerrit-Comment-Date: Wed, 15 Oct 2025 08:48:32 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: Yes
                                  Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                                  unsatisfied_requirement
                                  open
                                  diffy

                                  Fannie Zhang (Gerrit)

                                  unread,
                                  Oct 15, 2025, 4:53:26 AM10/15/25
                                  to goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                  Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                                  Fannie Zhang added 2 comments

                                  Patchset-level comments
                                  Michael Knyszek . resolved

                                  looks good overall -- one more comment for consistency, but that's all I've got. thank you!

                                  Fannie Zhang

                                  Thanks for the comments.

                                  File src/runtime/mspanset.go
                                  Line 181, Patchset 7: if goarch.IsArm64 == 1 {
                                  // Use a backoff approach to reduce demand to the shared memory location
                                  // decreases memory contention and allows for other threads to make quicker
                                  // progress.
                                  // Read more in this Arm blog post:
                                  // https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                                  procyield(backoff)
                                  // Increase backoff time.
                                  backoff += backoff >> 1
                                  }
                                  Michael Knyszek . resolved

                                  could you please also make this platform agnostic in the same way you did for lfstack?

                                  Fannie Zhang

                                  Of course, I forgot to update it. Thanks.

                                  Fannie Zhang

                                  Done

                                  Gerrit-Comment-Date: Wed, 15 Oct 2025 08:53:16 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: No
                                  Comment-In-Reply-To: Fannie Zhang <Fannie...@arm.com>
                                  Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                                  unsatisfied_requirement
                                  open
                                  diffy

                                  t hepudds (Gerrit)

                                  unread,
                                  Oct 15, 2025, 5:59:16 AM10/15/25
                                  to Fannie Zhang, goph...@pubsubhelper.golang.org, Emmanuel Odeke, Go LUCI, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                  Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Knyszek and Michael Pratt

                                  t hepudds voted Commit-Queue+1

                                  Commit-Queue+1
                                  Open in Gerrit

                                  Related details

                                  Attention is currently required from:
                                  • Emmanuel Odeke
                                  • Fannie Zhang
                                  • Ian Lance Taylor
                                  • Michael Knyszek
                                  • Michael Pratt
                                  Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not satisfiedLegacy-TryBots-Pass
                                  • requirement is not satisfiedNo-Unresolved-Comments
                                  • requirement is not satisfiedReview-Enforcement
                                  • requirement is not satisfiedTryBots-Pass
                                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                  Gerrit-MessageType: comment
                                  Gerrit-Project: go
                                  Gerrit-Branch: master
                                  Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                  Gerrit-Change-Number: 654895
                                  Gerrit-PatchSet: 8
                                  Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                  Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                  Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                  Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                  Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                  Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                  Gerrit-CC: Gopher Robot <go...@golang.org>
                                  Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                  Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                  Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                  Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                  Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                  Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                  Gerrit-Comment-Date: Wed, 15 Oct 2025 09:59:11 +0000
                                  Gerrit-HasComments: No
                                  Gerrit-Has-Labels: Yes
                                  unsatisfied_requirement
                                  open
                                  diffy

                                  t hepudds (Gerrit)

                                  unread,
                                  Oct 15, 2025, 9:05:48 AM10/15/25
                                  to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Emmanuel Odeke, Michael Knyszek, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                  Gerrit-Comment-Date: Wed, 15 Oct 2025 13:05:41 +0000
                                  Gerrit-HasComments: No
                                  Gerrit-Has-Labels: Yes
                                  unsatisfied_requirement
                                  open
                                  diffy

                                  Michael Knyszek (Gerrit)

                                  unread,
                                  Oct 15, 2025, 10:39:02 AM10/15/25
                                  to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                  Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Knyszek, Michael Pratt and t hepudds

                                  Michael Knyszek removed a vote from this change

                                  Removed Run-TryBot+1 by Fannie Zhang <Fannie...@arm.com>
                                  Open in Gerrit

                                  Related details

                                  Attention is currently required from:
                                  • Emmanuel Odeke
                                  • Fannie Zhang
                                  • Ian Lance Taylor
                                  • Michael Knyszek
                                  • Michael Pratt
                                  • t hepudds
                                  Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not satisfiedNo-Unresolved-Comments
                                    • requirement is not satisfiedReview-Enforcement
                                    • requirement is not satisfiedTryBots-Pass
                                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                    Gerrit-MessageType: deleteVote
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                    Gerrit-Change-Number: 654895
                                    Gerrit-PatchSet: 8
                                    Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                    Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                    Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                    Gerrit-CC: Gopher Robot <go...@golang.org>
                                    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                    Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                    Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Michael Knyszek (Gerrit)

                                    unread,
                                    Oct 15, 2025, 2:11:14 PM10/15/25
                                    to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                    Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                    Michael Knyszek voted Commit-Queue+1

                                    Commit-Queue+1
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Emmanuel Odeke
                                    • Fannie Zhang
                                    • Ian Lance Taylor
                                    • Michael Pratt
                                    • t hepudds
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not satisfiedNo-Unresolved-Comments
                                    • requirement is not satisfiedReview-Enforcement
                                    • requirement is not satisfiedTryBots-Pass
                                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                    Gerrit-MessageType: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                    Gerrit-Change-Number: 654895
                                    Gerrit-PatchSet: 8
                                    Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                    Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                    Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                    Gerrit-CC: Gopher Robot <go...@golang.org>
                                    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                    Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                    Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                    Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                    Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                    Gerrit-Comment-Date: Wed, 15 Oct 2025 18:11:10 +0000
                                    Gerrit-HasComments: No
                                    Gerrit-Has-Labels: Yes
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Fannie Zhang (Gerrit)

                                    unread,
                                    Oct 15, 2025, 8:34:14 PM10/15/25
                                    to goph...@pubsubhelper.golang.org, Michael Knyszek, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                    Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek, Michael Pratt and t hepudds

                                    Fannie Zhang voted Run-TryBot+1

                                    Run-TryBot+1
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Emmanuel Odeke
                                    • Ian Lance Taylor
                                    • Michael Knyszek
                                    • Michael Pratt
                                    • t hepudds
                                    Submit Requirements:
                                      • requirement is not satisfiedCode-Review
                                      • requirement is not satisfiedLegacy-TryBots-Pass
                                      • requirement is not satisfiedNo-Unresolved-Comments
                                      • requirement is not satisfiedReview-Enforcement
                                      • requirement is not satisfiedTryBots-Pass
                                      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                      Gerrit-MessageType: comment
                                      Gerrit-Project: go
                                      Gerrit-Branch: master
                                      Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                      Gerrit-Change-Number: 654895
                                      Gerrit-PatchSet: 9
                                      Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                      Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                      Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                      Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                      Gerrit-CC: Gopher Robot <go...@golang.org>
                                      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                      Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                      Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                      Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                      Gerrit-Comment-Date: Thu, 16 Oct 2025 00:34:05 +0000
                                      Gerrit-HasComments: No
                                      Gerrit-Has-Labels: Yes
                                      unsatisfied_requirement
                                      open
                                      diffy

                                      Michael Knyszek (Gerrit)

                                      unread,
                                      Oct 15, 2025, 8:47:26 PM10/15/25
                                      to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                      Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                      Michael Knyszek added 1 comment

                                      Patchset-level comments
                                      File-level comment, Patchset 9 (Latest):
                                      Gopher Robot . resolved

                                      TryBots beginning. Status page: https://farmer.golang.org/try?commit=fa722027

                                      Michael Knyszek

                                      Acknowledged

                                      Open in Gerrit

                                      Related details

                                      Attention is currently required from:
                                      • Emmanuel Odeke
                                      • Fannie Zhang
                                      • Ian Lance Taylor
                                      • Michael Pratt
                                      • t hepudds
                                      Submit Requirements:
                                        • requirement is not satisfiedCode-Review
                                        • requirement is not satisfiedLegacy-TryBots-Pass
                                        • requirement satisfiedNo-Unresolved-Comments
                                        • requirement is not satisfiedReview-Enforcement
                                        • requirement is not satisfiedTryBots-Pass
                                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                        Gerrit-MessageType: comment
                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                        Gerrit-Change-Number: 654895
                                        Gerrit-PatchSet: 9
                                        Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                        Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                        Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                        Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                        Gerrit-CC: Gopher Robot <go...@golang.org>
                                        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                        Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                        Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                        Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                        Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                        Gerrit-Comment-Date: Thu, 16 Oct 2025 00:47:22 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        Comment-In-Reply-To: Gopher Robot <go...@golang.org>
                                        unsatisfied_requirement
                                        satisfied_requirement
                                        open
                                        diffy

                                        Michael Knyszek (Gerrit)

                                        unread,
                                        Oct 15, 2025, 8:48:40 PM10/15/25
                                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                        Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                        Michael Knyszek added 1 comment

                                        Patchset-level comments
                                        Michael Knyszek . resolved

                                        FYI, don't use Run-TryBot+1 anymore. it's not going to do anything. it's the legacy trybots, and it's only useful if used in conjunction with the last few builders that haven't been ported over to the new system yet. use Commit-Queue+1 instead.

                                        Gerrit-Comment-Date: Thu, 16 Oct 2025 00:48:37 +0000
                                        Gerrit-HasComments: Yes
                                        Gerrit-Has-Labels: No
                                        unsatisfied_requirement
                                        satisfied_requirement
                                        open
                                        diffy

                                        Michael Knyszek (Gerrit)

                                        unread,
                                        Oct 15, 2025, 8:48:43 PM10/15/25
                                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                        Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                        Michael Knyszek voted Commit-Queue+1

                                        Commit-Queue+1
                                        Gerrit-Comment-Date: Thu, 16 Oct 2025 00:48:41 +0000
                                        Gerrit-HasComments: No
                                        Gerrit-Has-Labels: Yes
                                        unsatisfied_requirement
                                        satisfied_requirement
                                        open
                                        diffy

                                        Michael Knyszek (Gerrit)

                                        unread,
                                        Oct 15, 2025, 8:49:06 PM10/15/25
                                        to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                        Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                        Michael Knyszek removed a vote from this change

                                        Removed Run-TryBot+1 by Fannie Zhang <Fannie...@arm.com>

                                        Related details

                                        Attention is currently required from:
                                        • Emmanuel Odeke
                                        • Fannie Zhang
                                        • Ian Lance Taylor
                                        • Michael Pratt
                                        • t hepudds
                                        Submit Requirements:
                                          • requirement is not satisfiedCode-Review
                                          • requirement satisfiedNo-Unresolved-Comments
                                          • requirement is not satisfiedReview-Enforcement
                                          • requirement is not satisfiedTryBots-Pass
                                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                          Gerrit-MessageType: deleteVote
                                          unsatisfied_requirement
                                          satisfied_requirement
                                          open
                                          diffy

                                          Michael Knyszek (Gerrit)

                                          unread,
                                          Oct 15, 2025, 8:59:52 PM10/15/25
                                          to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                          Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                          Michael Knyszek added 1 comment

                                          Patchset-level comments
                                          Michael Knyszek . unresolved

                                          it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                          AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                          Open in Gerrit

                                          Related details

                                          Attention is currently required from:
                                          • Emmanuel Odeke
                                          • Fannie Zhang
                                          • Ian Lance Taylor
                                          • Michael Pratt
                                          • t hepudds
                                          Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not satisfiedNo-Unresolved-Comments
                                            • requirement is not satisfiedReview-Enforcement
                                            • requirement is not satisfiedTryBots-Pass
                                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                            Gerrit-MessageType: comment
                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                            Gerrit-Change-Number: 654895
                                            Gerrit-PatchSet: 9
                                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                            Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-CC: Gopher Robot <go...@golang.org>
                                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                            Gerrit-Comment-Date: Thu, 16 Oct 2025 00:59:49 +0000
                                            Gerrit-HasComments: Yes
                                            Gerrit-Has-Labels: No
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Fannie Zhang (Gerrit)

                                            unread,
                                            Oct 15, 2025, 9:19:16 PM10/15/25
                                            to goph...@pubsubhelper.golang.org, Michael Knyszek, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek, Michael Pratt and t hepudds

                                            Fannie Zhang added 1 comment

                                            Patchset-level comments
                                            Michael Knyszek . unresolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Ian Lance Taylor
                                            • Michael Knyszek
                                            • Michael Pratt
                                            • t hepudds
                                            Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not satisfiedNo-Unresolved-Comments
                                            • requirement is not satisfiedReview-Enforcement
                                            • requirement is not satisfiedTryBots-Pass
                                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                            Gerrit-MessageType: comment
                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                            Gerrit-Change-Number: 654895
                                            Gerrit-PatchSet: 9
                                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                            Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-CC: Gopher Robot <go...@golang.org>
                                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                            Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Comment-Date: Thu, 16 Oct 2025 01:19:07 +0000
                                            Gerrit-HasComments: Yes
                                            Gerrit-Has-Labels: No
                                            Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Michael Knyszek (Gerrit)

                                            unread,
                                            Oct 15, 2025, 11:25:19 PM10/15/25
                                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                            Michael Knyszek added 1 comment

                                            Patchset-level comments
                                            Michael Knyszek . unresolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Michael Knyszek

                                            maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Fannie Zhang
                                            • Ian Lance Taylor
                                            • Michael Pratt
                                            • t hepudds
                                            Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not satisfiedNo-Unresolved-Comments
                                            • requirement is not satisfiedReview-Enforcement
                                            • requirement is not satisfiedTryBots-Pass
                                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                            Gerrit-MessageType: comment
                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                            Gerrit-Change-Number: 654895
                                            Gerrit-PatchSet: 9
                                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                            Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-CC: Gopher Robot <go...@golang.org>
                                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                            Gerrit-Comment-Date: Thu, 16 Oct 2025 03:25:14 +0000
                                            Gerrit-HasComments: Yes
                                            Gerrit-Has-Labels: No
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Fannie Zhang (Gerrit)

                                            unread,
                                            Oct 17, 2025, 1:58:29 AM10/17/25
                                            to goph...@pubsubhelper.golang.org, Go LUCI, Michael Knyszek, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek, Michael Pratt and t hepudds

                                            Fannie Zhang added 2 comments

                                            Patchset-level comments
                                            Michael Knyszek . resolved

                                            FYI, don't use Run-TryBot+1 anymore. it's not going to do anything. it's the legacy trybots, and it's only useful if used in conjunction with the last few builders that haven't been ported over to the new system yet. use Commit-Queue+1 instead.

                                            Fannie Zhang

                                            Got it. Thanks.

                                            Michael Knyszek . unresolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Michael Knyszek

                                            maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                            Fannie Zhang

                                            In addition to amd64, ppc64, arm and 386 also have the same behavior. So I wonder if we can change the initial value of backoff to 1 to avoid modifying the implementation of multiple procyeield?

                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Ian Lance Taylor
                                            • Michael Knyszek
                                            • Michael Pratt
                                            • t hepudds
                                            Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not satisfiedNo-Unresolved-Comments
                                            • requirement is not satisfiedReview-Enforcement
                                            • requirement is not satisfiedTryBots-Pass
                                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                            Gerrit-MessageType: comment
                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                            Gerrit-Change-Number: 654895
                                            Gerrit-PatchSet: 9
                                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                            Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-CC: Gopher Robot <go...@golang.org>
                                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                            Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Comment-Date: Fri, 17 Oct 2025 05:58:20 +0000
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Michael Knyszek (Gerrit)

                                            unread,
                                            Oct 17, 2025, 1:23:15 PM10/17/25
                                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                            Michael Knyszek added 1 comment

                                            Patchset-level comments
                                            Michael Knyszek . unresolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Michael Knyszek

                                            maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                            Fannie Zhang

                                            In addition to amd64, ppc64, arm and 386 also have the same behavior. So I wonder if we can change the initial value of backoff to 1 to avoid modifying the implementation of multiple procyeield?

                                            Michael Knyszek

                                            ugh. I'll just send a change to fix that. frankly, it's a pretty awful pitfall of the API.

                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Fannie Zhang
                                            • Ian Lance Taylor
                                            • Michael Pratt
                                            • t hepudds
                                            Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not satisfiedNo-Unresolved-Comments
                                            • requirement is not satisfiedReview-Enforcement
                                            • requirement is not satisfiedTryBots-Pass
                                            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                            Gerrit-MessageType: comment
                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                            Gerrit-Change-Number: 654895
                                            Gerrit-PatchSet: 9
                                            Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                            Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                            Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                            Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-CC: Gopher Robot <go...@golang.org>
                                            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                            Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                            Gerrit-Attention: Michael Pratt <mpr...@google.com>
                                            Gerrit-Comment-Date: Fri, 17 Oct 2025 17:23:09 +0000
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Michael Knyszek (Gerrit)

                                            unread,
                                            Oct 17, 2025, 1:35:03 PM10/17/25
                                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor, Michael Pratt and t hepudds

                                            Michael Knyszek added 1 comment

                                            Patchset-level comments
                                            Michael Knyszek . unresolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Michael Knyszek

                                            maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                            Fannie Zhang

                                            In addition to amd64, ppc64, arm and 386 also have the same behavior. So I wonder if we can change the initial value of backoff to 1 to avoid modifying the implementation of multiple procyeield?

                                            Michael Knyszek

                                            ugh. I'll just send a change to fix that. frankly, it's a pretty awful pitfall of the API.

                                            Michael Knyszek

                                            or better yet, maybe we rename procyield to procyield0 and procyield becomes a Go function that checks for <= 0 and skips the call. that will compile down to nothing with a constant 0.

                                            Gerrit-Comment-Date: Fri, 17 Oct 2025 17:34:58 +0000
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Michael Pratt (Gerrit)

                                            unread,
                                            Oct 20, 2025, 2:53:14 PM10/20/25
                                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Michael Pratt, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and t hepudds

                                            Michael Pratt voted Code-Review+1

                                            Code-Review+1
                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Fannie Zhang
                                            • Ian Lance Taylor
                                            • t hepudds
                                            Gerrit-Comment-Date: Mon, 20 Oct 2025 18:53:09 +0000
                                            Gerrit-HasComments: No
                                            Gerrit-Has-Labels: Yes
                                            unsatisfied_requirement
                                            open
                                            diffy

                                            Michael Knyszek (Gerrit)

                                            unread,
                                            Oct 21, 2025, 10:39:50 AM10/21/25
                                            to Fannie Zhang, goph...@pubsubhelper.golang.org, Michael Pratt, Go LUCI, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                            Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and t hepudds

                                            Michael Knyszek added 1 comment

                                            Patchset-level comments
                                            Michael Knyszek . resolved

                                            it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                            AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                            Fannie Zhang

                                            Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                            Michael Knyszek

                                            maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                            Fannie Zhang

                                            In addition to amd64, ppc64, arm and 386 also have the same behavior. So I wonder if we can change the initial value of backoff to 1 to avoid modifying the implementation of multiple procyeield?

                                            Michael Knyszek

                                            ugh. I'll just send a change to fix that. frankly, it's a pretty awful pitfall of the API.

                                            Michael Knyszek

                                            or better yet, maybe we rename procyield to procyield0 and procyield becomes a Go function that checks for <= 0 and skips the call. that will compile down to nothing with a constant 0.

                                            Michael Knyszek

                                            I landed a change to both: make procyield stop looping infinitely, and to wrap procyield in a Go function. try rebasing!

                                            Open in Gerrit

                                            Related details

                                            Attention is currently required from:
                                            • Emmanuel Odeke
                                            • Fannie Zhang
                                            • Ian Lance Taylor
                                            • t hepudds
                                            Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement satisfiedNo-Unresolved-Comments
                                              • requirement is not satisfiedReview-Enforcement
                                              • requirement is not satisfiedTryBots-Pass
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: comment
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 9
                                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                              Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-CC: Gopher Robot <go...@golang.org>
                                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                              Gerrit-Comment-Date: Tue, 21 Oct 2025 14:39:47 +0000
                                              unsatisfied_requirement
                                              satisfied_requirement
                                              open
                                              diffy

                                              Fannie Zhang (Gerrit)

                                              unread,
                                              Oct 21, 2025, 9:19:49 PM10/21/25
                                              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                              Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and t hepudds

                                              Fannie Zhang uploaded new patchset

                                              Fannie Zhang uploaded patch set #10 to this change.
                                              Following approvals got outdated and were removed:
                                              • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Emmanuel Odeke
                                              • Fannie Zhang
                                              • Ian Lance Taylor
                                              • t hepudds
                                              Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement satisfiedNo-Unresolved-Comments
                                              • requirement is not satisfiedReview-Enforcement
                                              • requirement is not satisfiedTryBots-Pass
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: newpatchset
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 10
                                              unsatisfied_requirement
                                              satisfied_requirement
                                              open
                                              diffy

                                              Fannie Zhang (Gerrit)

                                              unread,
                                              Oct 21, 2025, 9:36:38 PM10/21/25
                                              to goph...@pubsubhelper.golang.org, Michael Pratt, Go LUCI, Michael Knyszek, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Knyszek and t hepudds

                                              Fannie Zhang voted and added 1 comment

                                              Votes added by Fannie Zhang

                                              Commit-Queue+1

                                              1 comment

                                              Patchset-level comments
                                              Michael Knyszek . resolved

                                              it seems the builders are timing out running make.bash. I can reproduce this locally. I'm not yet sure what the problem is, but there's probably a bug here where we're getting stuck in an infinite loop.

                                              AFAICT, the problem is that procyield(0) is invalid on amd64. :( the procyield assembly looks like it will loop infinitely if passed 0.

                                              Fannie Zhang

                                              Yes, that's why it fails. So we need to add a check to see if cyclys is equal to 0, and return if it is.

                                              Michael Knyszek

                                              maybe we should just fix procyield on amd64? it's bizarre that the behavior at 0 is just to loop forever 😄

                                              Fannie Zhang

                                              In addition to amd64, ppc64, arm and 386 also have the same behavior. So I wonder if we can change the initial value of backoff to 1 to avoid modifying the implementation of multiple procyeield?

                                              Michael Knyszek

                                              ugh. I'll just send a change to fix that. frankly, it's a pretty awful pitfall of the API.

                                              Michael Knyszek

                                              or better yet, maybe we rename procyield to procyield0 and procyield becomes a Go function that checks for <= 0 and skips the call. that will compile down to nothing with a constant 0.

                                              Michael Knyszek

                                              I landed a change to both: make procyield stop looping infinitely, and to wrap procyield in a Go function. try rebasing!

                                              Fannie Zhang

                                              Good approach! Done!

                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Emmanuel Odeke
                                              • Ian Lance Taylor
                                              • Michael Knyszek
                                              • t hepudds
                                              Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement satisfiedNo-Unresolved-Comments
                                              • requirement is not satisfiedReview-Enforcement
                                              • requirement is not satisfiedTryBots-Pass
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: comment
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 10
                                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                              Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-CC: Gopher Robot <go...@golang.org>
                                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                              Gerrit-Attention: Michael Knyszek <mkny...@google.com>
                                              Gerrit-Comment-Date: Wed, 22 Oct 2025 01:36:28 +0000
                                              Gerrit-HasComments: Yes
                                              Gerrit-Has-Labels: Yes
                                              unsatisfied_requirement
                                              satisfied_requirement
                                              open
                                              diffy

                                              Michael Knyszek (Gerrit)

                                              unread,
                                              Oct 22, 2025, 12:08:40 AM10/22/25
                                              to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                              Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and t hepudds

                                              Michael Knyszek voted Code-Review+2

                                              Code-Review+2
                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Emmanuel Odeke
                                              • Fannie Zhang
                                              • Ian Lance Taylor
                                              • t hepudds
                                              Submit Requirements:
                                              • requirement satisfiedCode-Review
                                              • requirement satisfiedNo-Unresolved-Comments
                                              • requirement satisfiedReview-Enforcement
                                              • requirement satisfiedTryBots-Pass
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: comment
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 10
                                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                              Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-CC: Gopher Robot <go...@golang.org>
                                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                              Gerrit-Comment-Date: Wed, 22 Oct 2025 04:08:37 +0000
                                              Gerrit-HasComments: No
                                              Gerrit-Has-Labels: Yes
                                              satisfied_requirement
                                              open
                                              diffy

                                              Michael Knyszek (Gerrit)

                                              unread,
                                              Oct 22, 2025, 12:08:48 AM10/22/25
                                              to Fannie Zhang, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                              Attention needed from Emmanuel Odeke, Fannie Zhang, Ian Lance Taylor and t hepudds

                                              Michael Knyszek added 1 comment

                                              Patchset-level comments
                                              File-level comment, Patchset 10 (Latest):
                                              Michael Knyszek . resolved

                                              thanks!

                                              Gerrit-Comment-Date: Wed, 22 Oct 2025 04:08:45 +0000
                                              Gerrit-HasComments: Yes
                                              Gerrit-Has-Labels: No
                                              satisfied_requirement
                                              open
                                              diffy

                                              Fannie Zhang (Gerrit)

                                              unread,
                                              Oct 22, 2025, 2:30:43 AM10/22/25
                                              to goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com
                                              Attention needed from Emmanuel Odeke, Ian Lance Taylor and t hepudds

                                              Fannie Zhang added 1 comment

                                              Patchset-level comments
                                              Michael Knyszek . resolved

                                              thanks!

                                              Fannie Zhang

                                              Thanks. Can I sumbit it?

                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Emmanuel Odeke
                                              • Ian Lance Taylor
                                              • t hepudds
                                              Submit Requirements:
                                              • requirement satisfiedCode-Review
                                              • requirement satisfiedNo-Unresolved-Comments
                                              • requirement satisfiedReview-Enforcement
                                              • requirement satisfiedTryBots-Pass
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: comment
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 10
                                              Gerrit-Owner: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Fannie Zhang <Fannie...@arm.com>
                                              Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
                                              Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
                                              Gerrit-Reviewer: t hepudds <thepud...@gmail.com>
                                              Gerrit-CC: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-CC: Gopher Robot <go...@golang.org>
                                              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                              Gerrit-Attention: t hepudds <thepud...@gmail.com>
                                              Gerrit-Comment-Date: Wed, 22 Oct 2025 06:30:33 +0000
                                              Gerrit-HasComments: Yes
                                              Gerrit-Has-Labels: No
                                              Comment-In-Reply-To: Michael Knyszek <mkny...@google.com>
                                              satisfied_requirement
                                              open
                                              diffy

                                              Michael Knyszek (Gerrit)

                                              unread,
                                              Oct 22, 2025, 8:02:35 PM10/22/25
                                              to Fannie Zhang, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Michael Pratt, t hepudds, Emmanuel Odeke, Ian Lance Taylor, Gopher Robot, golang-co...@googlegroups.com

                                              Michael Knyszek submitted the change

                                              Change information

                                              Commit message:
                                              runtime: use backoff and ISB instruction to reduce contention in (*lfstack).pop and (*spanSet).pop on arm64

                                              When profiling CPU usage LiveKit on AArch64/x86 (AWS), the graphs show
                                              CPU spikes that was repeating in a semi-periodic manner and spikes occur
                                              when the GC(garbage collector) is active.

                                              Our analysis found that the getempty function accounted for 10.54% of the
                                              overhead, which was mainly caused by the work.empty.pop() function. And
                                              listing pop shows that the majority of the time, with a 10.29% overhead,
                                              is spent on atomic.Cas64((*uint64)(head), old, next).

                                              This patch adds a backoff approach to reduce the high overhead of the
                                              atomic operation primarily occurs when contention over a specific memory
                                              address increases, typically with the rise in the number of threads.

                                              Note that on paltforms other than arm64, the initial value of backoff is zero.

                                              This patch rewrites the implementation of procyield() on arm64, which is an
                                              Armv8.0-A compatible delay function using the counter-timer.

                                              The garbage collector benchmark:

                                              │ master │ opt │
                                              │ sec/op │ sec/op vs base │
                                              Garbage/benchmem-MB=64-160 3.782m ± 4% 2.264m ± 2% -40.12% (p=0.000 n=10)
                                              │ user+sys-sec/op │ user+sys-sec/op vs base │
                                              Garbage/benchmem-MB=64-160 433.5m ± 4% 255.4m ± 2% -41.08% (p=0.000 n=10)

                                              Reference for backoff mechianism:
                                              https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/multi-threaded-applications-arm
                                              Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Reviewed-by: Michael Knyszek <mkny...@google.com>
                                              Reviewed-by: Michael Pratt <mpr...@google.com>
                                              Files:
                                              • M src/runtime/asm_arm64.s
                                              • M src/runtime/lfstack.go
                                              • M src/runtime/mspanset.go
                                              Change size: M
                                              Delta: 3 files changed, 80 insertions(+), 5 deletions(-)
                                              Branch: refs/heads/master
                                              Submit Requirements:
                                              • requirement satisfiedCode-Review: +2 by Michael Knyszek, +1 by Michael Pratt
                                              • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                                              Open in Gerrit
                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                              Gerrit-MessageType: merged
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: Ie8128a2243ceacbb82ab2a88941acbb8428bad94
                                              Gerrit-Change-Number: 654895
                                              Gerrit-PatchSet: 11
                                              open
                                              diffy
                                              satisfied_requirement
                                              Reply all
                                              Reply to author
                                              Forward
                                              0 new messages