(config *initConfig)
| 622 | } |
| 623 | |
| 624 | func 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 | |
| 641 | func setupIOPriority(config *initConfig) error { |
| 642 | const ioprioWhoPgrp = 1 |
no test coverage detected
searching dependent graphs…