mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue (batch tested with PRs 66862, 67618). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Use sync.map to scale equiv class cache better **What this PR does / why we need it**: Change the current lock in first level ecache into `sync.Map`, which is known for scaling better than `sync. Mutex ` on machines with >8 CPUs ref: https://golang.org/pkg/sync/#Map And the code is much cleaner in this way. 5k Nodes, 10k Pods benchmark with ecache enabled in 64 cores VM: ```bash // before BenchmarkScheduling/5000Nodes/0Pods-64 10000 17550089 ns/op // after BenchmarkScheduling/5000Nodes/0Pods-64 10000 16975098 ns/op ``` Comparing to current implementation, the improvement after this change is noticeable, and the test is stable in 8, 16, 64 cores VM. **Special notes for your reviewer**: **Release note**: ```release-note Use sync.map to scale ecache better ``` |
||
---|---|---|
.. | ||
algorithm | ||
algorithmprovider | ||
api | ||
cache | ||
core | ||
factory | ||
metrics | ||
testing | ||
util | ||
volumebinder | ||
BUILD | ||
OWNERS | ||
scheduler.go | ||
scheduler_test.go | ||
testutil.go |