Skip to content
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

file-hierarchy: Document the canonical mountpoint for cgroups #22624

Conversation

joshtriplett
Copy link
Contributor

file-hierarchy does not mention anything about the expected mountpoint
for cgroups. This may lead some software to believe it will need to
search for it (e.g. by scanning mountinfo) rather than just looking in
the canonical location.

Document the canonical mountpoint as /sys/fs/cgroup. Also provide enough
information for software looking for cgroup2 to know that it may want to
look under /sys/fs/cgroup/unified as a fallback.

@keszybz
Copy link
Member

keszybz commented Feb 25, 2022

Seems reasonable to document this. We certainly want to describe a setup with cgroupv2. I'm not sure if we want to describe hybrid and v1 too though. I'll let others comment.

@joshtriplett
Copy link
Contributor Author

@keszybz Seemed painless to allow for the hybrid setup, insofar as it tells code looking for v2 to consider a fallback to /sys/fs/cgroup/unified. Happy to adapt this to whatever degree systemd would prefer to document this, though.

@keszybz keszybz added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Feb 28, 2022
file-hierarchy does not mention anything about the expected mountpoint
for cgroups. This may lead some software to believe it will need to
search for it (e.g. by scanning mountinfo) rather than just looking in
the canonical location.

Document the canonical mountpoint as /sys/fs/cgroup. Also provide
information on the non-default configurations, but
make it clear that in such configurations if cgroup2 is mounted (hybrid
mode) it won't have resource controllers attached. This will help
software know if it should fall back to /sys/fs/cgroup/unified or just
ignore that case.
@joshtriplett joshtriplett force-pushed the file-hierarchy-document-cgroup-canonical-mountpoint branch from ac7db6c to a0b34a3 Compare March 1, 2022 01:42
@joshtriplett
Copy link
Contributor Author

I've updated the PR to more carefully cover hybrid/legacy setups. I've also made it clear that if cgroup2 is mounted on /sys/fs/cgroup/unified/ it won't have any resource controllers attached, so software looking for cgroup2 resource controllers needn't bother falling back to that directory.

@yuwata yuwata added please-review and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Mar 1, 2022
@keszybz
Copy link
Member

keszybz commented Mar 1, 2022

LGTM. I guess we could add further tweaks, like more hyperlinks, but we can do that separately.

@keszybz keszybz merged commit c8aeb9d into systemd:main Mar 1, 2022
@joshtriplett joshtriplett deleted the file-hierarchy-document-cgroup-canonical-mountpoint branch March 1, 2022 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants