Files
kubernetes/pkg/scheduler/framework/plugins/gangscheduling
Abel Feng 2153ed1852 scheduler: optimize podGroupInfo to minimize the lock time
Gang scheduler will add the pod into the podGroupInfo before pod
enqueue, if there are thousands of pods in a podGroupInfo, The
call of AssumedPods, AssignedPods and AllPods will hold the lock and
clone the map, so that new Pods should wait there for a long time to add into
the podGroupInfo, also it will be a long wait to enqueue the pod.

In our test, a pod will wait seconds to enqueue if we have 50000 pod in
a gang group.

In this PR, we can avoid the traverse and clone of the map by adding
AllPodsCount, AssumedPodsCount, AssignedPodsCount method, and we make
sure that assumed pods and assigned pods are disjoint.
2026-03-11 17:21:36 +08:00
..