From 980ef25b43cbae064f9c9cff0b589b2adbc72f1f Mon Sep 17 00:00:00 2001 From: wingrez Date: Tue, 22 Jul 2025 23:44:34 +0800 Subject: [PATCH] runtime: deduct assist credit when gcBlackenEnabled [CL614257](https://go-review.googlesource.com/c/go/+/614257) has changed the original behavior. This modification will restore it. --- src/runtime/arena.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/arena.go b/src/runtime/arena.go index e80799581052a0..0aa3876aaa1a74 100644 --- a/src/runtime/arena.go +++ b/src/runtime/arena.go @@ -745,7 +745,9 @@ func newUserArenaChunk() (unsafe.Pointer, *mspan) { // does represent additional work for the GC, but we also have no idea // what that looks like until we actually allocate things into the // arena). - deductAssistCredit(userArenaChunkBytes) + if gcBlackenEnabled != 0 { + deductAssistCredit(userArenaChunkBytes) + } // Set mp.mallocing to keep from being preempted by GC. mp := acquirem()