Skip to content

Commit 6d44922

Browse files
committed
autosize: handle SMT in autosizing
consider the real SMT Level when doing autosize computations. Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent 04da524 commit 6d44922

File tree

1 file changed

+2
-2
lines changed
  • pkg/performanceprofile/profilecreator/autosize

1 file changed

+2
-2
lines changed

pkg/performanceprofile/profilecreator/autosize/autosize.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (p Params) SMTLevel() int {
9191
func (p Params) DefaultControlPlaneCores() int {
9292
// intentionally overallocate to have a safe baseline
9393
Tc := p.totalCPUs
94-
return int(math.Round(float64(Tc) * defaultReservedRatioInitial)) // TODO handle SMT
94+
return int(math.Round(float64(Tc) * defaultReservedRatioInitial))
9595
}
9696

9797
// Get x_c, x_w as initial hardcoded value. Subject to optimization
@@ -147,7 +147,7 @@ func (vals Values) String() string {
147147
// https://github.com/gonum/gonum/issues/1725
148148
func Validate(params Params, vals Values) error {
149149
Tc := params.TotalCPUs()
150-
if vals.ReservedCPUCount < 1 { // TODO handle SMT
150+
if vals.ReservedCPUCount < params.SMTLevel() {
151151
return ErrUnderallocatedControlPlane
152152
}
153153
if vals.ReservedCPUCount > int(math.Round((float64(Tc) * defaultReservedRatioMax))) { // works, but likely unacceptable

0 commit comments

Comments
 (0)