2021-03-25 02:09:37 +00:00
|
|
|
package fingerprint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/client/lib/cgutil"
|
|
|
|
)
|
|
|
|
|
2021-03-29 18:05:12 +00:00
|
|
|
func (f *CPUFingerprint) deriveReservableCores(req *FingerprintRequest) ([]uint16, error) {
|
2021-04-08 05:03:58 +00:00
|
|
|
parent := req.Config.CgroupParent
|
|
|
|
if parent == "" {
|
|
|
|
parent = cgutil.DefaultCgroupParent
|
|
|
|
}
|
|
|
|
return cgutil.GetCPUsFromCgroup(parent)
|
2021-03-25 02:09:37 +00:00
|
|
|
}
|