mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-24 21:13:16 +00:00
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.