-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
systemd cgroup driver: Split support for unified cgroup2 hierarchy into its own Manager #2114
Conversation
Detection is done only once, as the manager is instantiated, and then the two implementations are for the most part separate. This will allow us to iterate on the unified cgroup2 implementation without worrying about compatibility with the legacy implementation. For now, the unified cgroup2 implementation consists of stubs that need to be filled up with actual implementation. Signed-off-by: Filipe Brandenburger <[email protected]>
Works for me. But @giuseppe is doing the work. |
@filbranden thanks for putting this up!
In the PR I've opened the detection is also done only once (using a
I am fine with some higher level refactoring and split the implementation into a new manager. The biggest part seems to be how to we will handle the subsystems manager. Are we going to have two versions of I thought of splitting it in something like:
func (s *CpuGroup) Apply(d *cgroupData) error {
if cgroups.IsCgroup2UnifiedMode() {
return s.ApplyUnified(d)
} else {
return s.ApplyLegacy(d)
}
} what do you think? |
I feel like reusing the current Why not create a new Yes, there's perhaps some opportunity for reuse of code currently in fs and in systemd legacy cgroup, but I guess then just refactoring those bits to export the relevant bits would be good. Does that make sense? |
yes thanks, I'll refactor the code and split cgroups v2 stuff in new files under I won't be available next week, so it might take some time before I submit an updated version. |
Sounds good @giuseppe ! Yes, adding those to Whenever you have a new PR, I'm happy to review it. Cheers! |
Paths: paths, | ||
} | ||
}, nil | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you don't need else
here. Some lint tool may print a warning.
needs rebase |
Split support for unified cgroup2 hierarchy into its own Manager in the systemd cgroup driver
Detection is done only once, as the manager is instantiated, and then the two implementations are for the most part separate.
This will allow us to iterate on the unified cgroup2 implementation without worrying about compatibility with the legacy implementation.
For now, the unified cgroup2 implementation consists of stubs that need to be filled up with actual implementation.
/cc @giuseppe @rhatdan
I think I'd prefer if we started from a split like this, then added the bits needed for cgroup2 support. What do you think?