Skip to content

daemon: move check for CPU-realtime daemon options#43131

Merged
thaJeztah merged 1 commit into
moby:masterfrom
thaJeztah:move_cpu_realtime_checks
Mar 7, 2022
Merged

daemon: move check for CPU-realtime daemon options#43131
thaJeztah merged 1 commit into
moby:masterfrom
thaJeztah:move_cpu_realtime_checks

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

follow-up to #43130

Perform the validation when the daemon starts instead of performing these
validations for each individual container, so that we can fail early.

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Comment thread daemon/oci_linux.go
Comment on lines -821 to -830
if cdcgroups.Mode() == cdcgroups.Unified {
return errors.New("daemon-scoped cpu-rt-period and cpu-rt-runtime are not implemented for cgroup v2")
}

// FIXME this is very expensive way to check if cpu rt is supported
sysInfo := daemon.RawSysInfo()
if !sysInfo.CPURealtime {
return errors.New("daemon-scoped cpu-rt-period and cpu-rt-runtime are not supported by the kernel")
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have merged #43130, we could consider to keep the check here as well, but I don't think we would need it if we make the daemon fail to start with these options set

@thaJeztah thaJeztah force-pushed the move_cpu_realtime_checks branch 2 times, most recently from bd2fa3b to 1637aa6 Compare January 7, 2022 23:05
@thaJeztah

This comment was marked as outdated.

@thaJeztah thaJeztah force-pushed the move_cpu_realtime_checks branch from 1637aa6 to d907ca2 Compare January 10, 2022 09:54
@thaJeztah thaJeztah force-pushed the move_cpu_realtime_checks branch from d907ca2 to 89902f0 Compare February 18, 2022 17:22
@thaJeztah thaJeztah added this to the 21.xx milestone Feb 18, 2022
@thaJeztah thaJeztah marked this pull request as ready for review February 18, 2022 19:06
@thaJeztah
Copy link
Copy Markdown
Member Author

@tianon @AkihiroSuda ptal

Comment thread cmd/dockerd/daemon_linux.go Outdated
return errors.New("daemon-scoped cpu-rt-period and cpu-rt-runtime are not implemented for cgroup v2")
}

// FIXME this is very expensive way to check if cpu rt is supported
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expensive enough that we should skip it for now or just that we should think about maybe finding an alternative "eventually" ? (Given that this is a comment and the check is here, I'm assuming the latter? 🙈)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so I doubted it I should just remove it now. Previously it was part of "container create", so far more critical if it was slow. Now that it's in the daemon startup, I guess it's not really a problem anymore (only done once / twice at startup)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the TODO / comment 👍

Perform the validation when the daemon starts instead of performing these
validations for each individual container, so that we can fail early.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the move_cpu_realtime_checks branch from 89902f0 to 5263bea Compare March 3, 2022 18:50
@thaJeztah
Copy link
Copy Markdown
Member Author

@AkihiroSuda PTAL

@thaJeztah
Copy link
Copy Markdown
Member Author

Thanks @AkihiroSuda ! If you find some time at some point, perhaps you could have a look at #43213 (you probably know more about that from the top of your head than I do 😅)

@thaJeztah thaJeztah merged commit 011e1c7 into moby:master Mar 7, 2022
@thaJeztah thaJeztah deleted the move_cpu_realtime_checks branch March 7, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants