diff --git a/pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go b/pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go index ec36f1bf75..c77dd399d5 100644 --- a/pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go +++ b/pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go @@ -32,7 +32,7 @@ var ( // BalancedResourceAllocationMap should **NOT** be used alone, and **MUST** be used together // with LeastRequestedPriority. It calculates the difference between the cpu and memory fraction // of capacity, and prioritizes the host based on how close the two metrics are to each other. - // Detail: score = 10 - abs(cpuFraction-memoryFraction)*10. The algorithm is partly inspired by: + // Detail: score = 10 - variance(cpuFraction,memoryFraction,volumeFraction)*10. The algorithm is partly inspired by: // "Wei Huang et al. An Energy Efficient Virtual Machine Placement Algorithm with Balanced // Resource Utilization" BalancedResourceAllocationMap = balancedResourcePriority.PriorityMap diff --git a/pkg/scheduler/algorithm/priorities/image_locality.go b/pkg/scheduler/algorithm/priorities/image_locality.go index 2d399469d6..00820f2b4e 100644 --- a/pkg/scheduler/algorithm/priorities/image_locality.go +++ b/pkg/scheduler/algorithm/priorities/image_locality.go @@ -59,7 +59,7 @@ func calculateScoreFromSize(sumSize int64) int { switch { case sumSize == 0 || sumSize < minImgSize: // 0 means none of the images required by this pod are present on this - // node or the total size of the images present is too small to be taken into further consideration. + // node or the total size of the images present are too small to be taken into further consideration. return 0 case sumSize >= maxImgSize: diff --git a/pkg/scheduler/algorithm/priorities/least_requested.go b/pkg/scheduler/algorithm/priorities/least_requested.go index 9f8b78dae6..d691810896 100644 --- a/pkg/scheduler/algorithm/priorities/least_requested.go +++ b/pkg/scheduler/algorithm/priorities/least_requested.go @@ -29,7 +29,7 @@ var ( // prioritizes based on the minimum of the average of the fraction of requested to capacity. // // Details: - // cpu((capacity-sum(requested))*10/capacity) + memory((capacity-sum(requested))*10/capacity)/2 + // (cpu((capacity-sum(requested))*10/capacity) + memory((capacity-sum(requested))*10/capacity))/2 LeastRequestedPriorityMap = leastResourcePriority.PriorityMap ) diff --git a/pkg/scheduler/algorithm/priorities/most_requested.go b/pkg/scheduler/algorithm/priorities/most_requested.go index ea12e8ef89..f1cc7c6ad5 100644 --- a/pkg/scheduler/algorithm/priorities/most_requested.go +++ b/pkg/scheduler/algorithm/priorities/most_requested.go @@ -39,10 +39,10 @@ func mostResourceScorer(requested, allocable *schedulercache.Resource, includeVo // The used capacity is calculated on a scale of 0-10 // 0 being the lowest priority and 10 being the highest. // The more resources are used the higher the score is. This function -// is almost a reversed version of least_requested_priority.calculatUnusedScore +// is almost a reversed version of least_requested_priority.calculateUnusedScore // (10 - calculateUnusedScore). The main difference is in rounding. It was added to // keep the final formula clean and not to modify the widely used (by users -// in their default scheduling policies) calculateUSedScore. +// in their default scheduling policies) calculateUsedScore. func mostRequestedScore(requested, capacity int64) int64 { if capacity == 0 { return 0 diff --git a/pkg/scheduler/algorithm/priorities/resource_limits.go b/pkg/scheduler/algorithm/priorities/resource_limits.go index 165ac3e3e4..816b423f58 100644 --- a/pkg/scheduler/algorithm/priorities/resource_limits.go +++ b/pkg/scheduler/algorithm/priorities/resource_limits.go @@ -70,7 +70,7 @@ func ResourceLimitsPriorityMap(pod *v1.Pod, meta interface{}, nodeInfo *schedule }, nil } -// computeScore return 1 if limit value is less than or equal to allocable +// computeScore returns 1 if limit value is less than or equal to allocatable // value, otherwise it returns 0. func computeScore(limit, allocatable int64) int64 { if limit != 0 && allocatable != 0 && limit <= allocatable {