File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 99 "strconv"
1010
1111 "github.com/docker/go-units"
12+ "github.com/opencontainers/runc/libcontainer/intelrdt"
1213 "github.com/opencontainers/runtime-spec/specs-go"
1314 "github.com/urfave/cli"
1415)
@@ -112,6 +113,10 @@ other options are ignored.
112113 Name : "pids-limit" ,
113114 Usage : "Maximum number of pids allowed in the container" ,
114115 },
116+ cli.StringFlag {
117+ Name : "l3-cache-schema" ,
118+ Usage : "The string of Intel RDT/CAT L3 cache schema" ,
119+ },
115120 },
116121 Action : func (context * cli.Context ) error {
117122 if err := checkArgs (context , 1 , exactArgs ); err != nil {
@@ -254,6 +259,14 @@ other options are ignored.
254259 config .Cgroups .Resources .MemorySwap = * r .Memory .Swap
255260 config .Cgroups .Resources .PidsLimit = r .Pids .Limit
256261
262+ if val := context .String ("l3-cache-schema" ); val != "" {
263+ // Avoid silent failure in container.Set()
264+ if ! intelrdt .IsEnabled () || config .IntelRdt == nil {
265+ return fmt .Errorf ("l3 cache schema is not enabled or not specified in config, update value '%s' is discarded" , val )
266+ }
267+ config .IntelRdt .L3CacheSchema = val
268+ }
269+
257270 return container .Set (config )
258271 },
259272}
You can’t perform that action at this time.
0 commit comments