@@ -462,11 +462,11 @@ func (m *Manager) Apply(pid int) (err error) {
462
462
m .mu .Lock ()
463
463
defer m .mu .Unlock ()
464
464
465
- if m .config .IntelRdt .ClosID != "" && m .config .IntelRdt .L3CacheSchema == "" && m .config .IntelRdt .MemBwSchema == "" {
465
+ if m .config .IntelRdt .ClosID != "" && m .config .IntelRdt .L3CacheSchema == "" && m .config .IntelRdt .MemBwSchema == "" && len ( m . config . IntelRdt . Schemata ) == 0 {
466
466
// Check that the CLOS exists, i.e. it has been pre-configured to
467
467
// conform with the runtime spec
468
468
if _ , err := os .Stat (path ); err != nil {
469
- return fmt .Errorf ("clos dir not accessible (must be pre-created when l3CacheSchema and memBwSchema are empty): %w" , err )
469
+ return fmt .Errorf ("clos dir not accessible (must be pre-created when schemata, l3CacheSchema and memBwSchema are empty): %w" , err )
470
470
}
471
471
}
472
472
@@ -648,23 +648,19 @@ func (m *Manager) Set(container *configs.Config) error {
648
648
// the value written in does not necessarily match what gets read out
649
649
// (leading zeros, cache id ordering etc).
650
650
651
- // Write a single joint schema string to schemata file
652
- if l3CacheSchema != "" && memBwSchema != "" {
653
- if err := writeFile (path , "schemata" , l3CacheSchema + "\n " + memBwSchema ); err != nil {
654
- return err
655
- }
651
+ parts := []string {}
652
+ if l3CacheSchema != "" {
653
+ parts = append (parts , l3CacheSchema )
656
654
}
657
-
658
- // Write only L3 cache schema string to schemata file
659
- if l3CacheSchema != "" && memBwSchema == "" {
660
- if err := writeFile (path , "schemata" , l3CacheSchema ); err != nil {
661
- return err
662
- }
655
+ if memBwSchema != "" {
656
+ parts = append (parts , memBwSchema )
663
657
}
658
+ parts = append (parts , container .IntelRdt .Schemata ... )
664
659
665
- // Write only memory bandwidth schema string to schemata file
666
- if l3CacheSchema == "" && memBwSchema != "" {
667
- if err := writeFile (path , "schemata" , memBwSchema ); err != nil {
660
+ // Write a single joint schema string to schemata file
661
+ schemata := strings .Join (parts , "\n " )
662
+ if schemata != "" {
663
+ if err := writeFile (path , "schemata" , schemata ); err != nil {
668
664
return err
669
665
}
670
666
}
0 commit comments