MCPcopy
hub / github.com/opencontainers/runc / setupScheduler

Function setupScheduler

libcontainer/init_linux.go:624–639  ·  view source on GitHub ↗
(config *initConfig)

Source from the content-addressed store, hash-verified

622}
623
624func setupScheduler(config *initConfig) error {
625 if config.Scheduler == nil {
626 return nil
627 }
628 attr, err := configs.ToSchedAttr(config.Scheduler)
629 if err != nil {
630 return err
631 }
632 if err := unix.SchedSetAttr(0, attr, 0); err != nil {
633 if errors.Is(err, unix.EPERM) && config.Config.Cgroups.CpusetCpus != "" {
634 return errors.New("process scheduler can't be used together with AllowedCPUs")
635 }
636 return fmt.Errorf("error setting scheduler: %w", err)
637 }
638 return nil
639}
640
641func setupIOPriority(config *initConfig) error {
642 const ioprioWhoPgrp = 1

Callers 2

InitMethod · 0.85
InitMethod · 0.85

Calls 1

ToSchedAttrFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…