libcontainer/intelrdt: rm init() from intelrdt.go

Use sync.Once to init Intel RDT when needed for a small speedup to
operations which do not require Intel RDT.

Simplify IntelRdtManager initialization in LinuxFactory.

Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
This commit is contained in:
Xiaochen Shen
2020-12-16 23:37:31 +08:00
parent 544048b865
commit 325a74ddec
5 changed files with 63 additions and 54 deletions
+1
View File
@@ -6,6 +6,7 @@ var (
// Check if Intel RDT/CMT is enabled.
func IsCMTEnabled() bool {
featuresInit()
return cmtEnabled
}