kubernetes/pkg/scheduler/core
Kubernetes Submit Queue 4cca6a89a0
Merge pull request #66862 from resouer/sync-map
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
```
2018-08-21 00:24:01 -07:00
..
equivalence Merge pull request #66862 from resouer/sync-map 2018-08-21 00:24:01 -07:00
BUILD update bazel 2018-07-26 17:37:29 +08:00
extender_test.go Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
extender.go Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00
generic_scheduler_test.go Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
generic_scheduler.go Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
scheduling_queue_test.go use subtest for table units 2018-07-20 16:02:50 -04:00
scheduling_queue.go fix error log 2018-07-26 19:48:48 +08:00