-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On some systems, mounting cgroup v1 by setup_emulated_subsystem
may missing some subsystems
#2743
Comments
Thanks for your report, @JCKeep
What does this mean? May I ask you to give me a more specific example or something? |
@utam0k youki scan for example, it may not mount
in #[cfg(feature = "v1")]
fn setup_emulated_subsystem(
&self,
cgroup_mount: &SpecMount,
options: &MountOptions,
subsystem_name: &str,
named: bool,
host_mount: &Path,
process_cgroups: &HashMap<String, String>,
) -> Result<()> {
tracing::debug!("Mounting (emulated) {:?} cgroup subsystem", subsystem_name);
let named_hierarchy: Cow<str> = if named {
format!("name={subsystem_name}").into()
} else {
subsystem_name.into()
};
// we search "net_cls,net_prio", but it store "net_prio,net_cls"
if let Some(proc_path) = process_cgroups.get(named_hierarchy.as_ref()) {
....
} else {
tracing::warn!("Could not mount {:?} cgroup subsystem", subsystem_name);
} |
I understood this problem. I have a question. How does runc handle this case? Do you know? |
@utam0k runc works |
@JCKeep We should fix it, but I wonder how runc treats it. |
@utam0k runc use the mount options of |
@JCKeep Which code? |
@utam0k you may have a look at function mountCgroupV1 and getCgroupMountsHelper |
Why don't you align to runc's implementation? |
I'm writing an oci runtime using some youki's source code by learning, and find some bugs.
On my system,
/proc/self/cgroup
file be like:the
cpuacct,cpu
andnet_prio,net_cls
was unsorted, so in functionmount_cgroup_v1
:process_cgroups
will recordcpuacct,cpu
andnet_prio,net_cls
, but system comount in namecpu,cpuacct
andnet_cls,net_prio
, so when usingsetup_emulated_subsystem
it find no subsystem to bind.So when I test, it will not mount some cgroupv1 subsystems and not generate error.
I fixed it on my system like this, mybe this will work for other system?
The text was updated successfully, but these errors were encountered: