Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
66e0b53c
Commit
66e0b53c
authored
Jun 22, 2018
by
xiechengsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some typos
Signed-off-by:
xiechengsheng
<
XIE1995@whut.edu.cn
>
parent
cd65afdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
balanced_resource_allocation.go
...uler/algorithm/priorities/balanced_resource_allocation.go
+5
-5
No files found.
pkg/scheduler/algorithm/priorities/balanced_resource_allocation.go
View file @
66e0b53c
...
@@ -44,8 +44,8 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
...
@@ -44,8 +44,8 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
// This to find a node which has most balanced CPU, memory and volume usage.
// This to find a node which has most balanced CPU, memory and volume usage.
if
includeVolumes
&&
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
BalanceAttachedNodeVolumes
)
&&
allocatableVolumes
>
0
{
if
includeVolumes
&&
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
BalanceAttachedNodeVolumes
)
&&
allocatableVolumes
>
0
{
volumeFraction
:=
float64
(
requestedVolumes
)
/
float64
(
allocatableVolumes
)
volumeFraction
:=
float64
(
requestedVolumes
)
/
float64
(
allocatableVolumes
)
if
cpuFraction
>
1
||
memoryFraction
>
1
||
volumeFraction
>
1
{
if
cpuFraction
>
=
1
||
memoryFraction
>=
1
||
volumeFraction
>=
1
{
// if requested > capacity, the corresponding host should never be preferred.
// if requested >
=
capacity, the corresponding host should never be preferred.
return
0
return
0
}
}
// Compute variance for all the three fractions.
// Compute variance for all the three fractions.
...
@@ -57,8 +57,8 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
...
@@ -57,8 +57,8 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
return
int64
((
1
-
variance
)
*
float64
(
schedulerapi
.
MaxPriority
))
return
int64
((
1
-
variance
)
*
float64
(
schedulerapi
.
MaxPriority
))
}
}
if
cpuFraction
>
1
||
memoryFraction
>
1
{
if
cpuFraction
>
=
1
||
memoryFraction
>=
1
{
// if requested > capacity, the corresponding host should never be preferred.
// if requested >
=
capacity, the corresponding host should never be preferred.
return
0
return
0
}
}
// Upper and lower boundary of difference between cpuFraction and memoryFraction are -1 and 1
// Upper and lower boundary of difference between cpuFraction and memoryFraction are -1 and 1
...
@@ -71,7 +71,7 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
...
@@ -71,7 +71,7 @@ func balancedResourceScorer(requested, allocable *schedulercache.Resource, inclu
func
fractionOfCapacity
(
requested
,
capacity
int64
)
float64
{
func
fractionOfCapacity
(
requested
,
capacity
int64
)
float64
{
if
capacity
==
0
{
if
capacity
==
0
{
return
math
.
MaxFloat64
return
1
}
}
return
float64
(
requested
)
/
float64
(
capacity
)
return
float64
(
requested
)
/
float64
(
capacity
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment