Skip to content

Commit 6f32d20

Browse files
committed
runtime: pace the scavenger according to 1% of overall CPU time
Currently the scavenger is paced to 1% of 1 CPU because it had scalability problems. As of the last few CLs, that should be largely resolved. This change resolves the TODO and paces the scavenger according to 1% of overall CPU time. This change is made separately to allow it to be more easily rolled back. Change-Id: I1ab4de24ba41c564960701634a128a813c55ece9 Reviewed-on: https://go-review.googlesource.com/c/go/+/358675 Trust: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent e48e4b4 commit 6f32d20

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/runtime/mgcscavenge.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,7 @@ func bgscavenge(c chan int) {
272272

273273
// idealFraction is the ideal % of overall application CPU time that we
274274
// spend scavenging.
275-
//
276-
// TODO(mknyszek): Currently this is percent of one CPU (hence the division
277-
// by gomaxprocs), but ideally this should be 1% of overall CPU time.
278-
// Given a scalable memory allocator, it makes sense that the scavenger
279-
// should scale with it; if you're allocating more frequently, then presumably
280-
// you're also generating more work from the scavenger.
281-
idealFraction := float64(scavengePercent) / 100.0 / float64(gomaxprocs)
275+
idealFraction := float64(scavengePercent) / 100.0
282276

283277
// Input: fraction of CPU time used.
284278
// Setpoint: idealFraction.

0 commit comments

Comments
 (0)