Another daemon for managing control groups
Another daemon for managing control groups
Posted Dec 5, 2013 13:26 UTC (Thu) by mezcalero (subscriber, #45103)In reply to: Another daemon for managing control groups by tdalman
Parent article: Another daemon for managing control groups
When you start services at boot-up, then you need to start them in the right order, possibly waiting for devices to show up first. Here's an example: for each block device that needs to be mounted, we first need to wait until it shows up (this is because device management is entirely hotpluggy and dynamic these days), then we need to run the "fsck" service on it. Then we need to mount it. Finally, after we did that for all file systems listed in /etc/fstab we can go on to the next step, and start the next service, for example apache, which expects all those file systems to have shown up, fscked, and mounted. So there you have the connection between device and service management.
Now, if you start services like apache and mysql, then in a large part of cases you want to resource manage them. Actually, without even configuring something explicitly it is highly preferable if apache and mysql get roughly the same amount of resources, even though apache runs tons of worker and CGI processes, and mysql only very few worker threads. Because if you don't even that out then apache might starve mysql to death even though it needs its service. Sooo. there you have the connection between service and cgroup management: for the services you start you need to set up cgroups and contain the service processes in them, racefreely, and unconditionally. So there you have the connection between cgroup and service management.
In addition there's also the third connection: between device and cgroup management. That's because for a number of cgroup properties you need to configure major/minor device ids. For example the "blkio" and "devices" controllers rely on that to set resource or access constraints per device. Now, major/minor assignment by the kernel is pretty much dynamic these days. Basically, before a device has shown up you cannot know which major/minor it will get. A cgroup manager which gets told to configure a 5MB/s bandwidth limit for a specific cgroup for a specific device hence needs to refresh the list of limits in the cgroup each time any device in that list pops up or is removed. Since admins probably prefer specifiying their devices with the stable per-uuid or per-path symlinks that udev creates the cgroup manager hence needs to be integrated with udev.
So there you have it: there's a connection between all three areas, in all directions.
      Posted Jan 3, 2014 18:08 UTC (Fri)
                               by aigarius (subscriber, #7329)
                              [Link] (3 responses)
       
It seems that systemd developers not only "look at all that was before and found it lacking", but also at that point stopped looking and thinking outside the box that they put themselves into. Refusing cooperation with other projects and instead trying embrace-and-extend them is a huge red flag in free software communities. That never ends well. 
     
    
      Posted Jan 3, 2014 18:44 UTC (Fri)
                               by Cyberax (✭ supporter ✭, #52523)
                              [Link] (2 responses)
       
In the new world order only ONE process will be able to create/modify cgroups. That's going to be a kernel requirement. 
This in turn requires cgroups management daemon to be constantly active. 
     
    
      Posted Jan 3, 2014 19:13 UTC (Fri)
                               by dlang (guest, #313)
                              [Link] (1 responses)
       
only for the short term until they figure out how to allow for wider access. (and even then the old way will remain for compatibility for a while) 
It also would't the only time some kernel developers have said that there was going to be a kernel requirement that they later back away from before enforcing it. 
so it's very possible that there will never be a kernel release that will require only having one process manage cgroups 
     
    
      Posted Jan 3, 2014 20:26 UTC (Fri)
                               by Cyberax (✭ supporter ✭, #52523)
                              [Link] 
       
And that's actually my sticking point with cgroups - I think that cgroups nesting and delegation is a must.  
>(and even then the old way will remain for compatibility for a while) 
 
     
    Another daemon for managing control groups
      
Init systems have communicated with udev for startup for years before systemd came along. It is trivial and elegant - you start the udev and then start a service to mount/fsck all the filesystems. This service might do the work itself or just ask udev if its done the work - none of that matters to the init. Init only needs to know when the filesystems are ready for the start of launching of other services, which is communicated by the script exiting with exit code 0.
Init system does not have to include a cgroup manager to start services in their appropriate cgroups, you can trivially provide an equivalent of cgroups-launch wrapper that would communicate with a cgroups daemon and ensure that cgroup is switched before launching the secondary executable. Init system might provide a handy shorthand, for example that if a CGRoup option is specified for a service, then it will be launched via a cgroups-launch wrapper with the CGroup contents passed on to that launcher as a parameter. Trivial, decoupled, just as functional.
And cgroups daemon can trivially provide hooks for the udev to call when devices are added or removed in the usual way. There is no need to invent some tight coupling.
Another daemon for managing control groups
      
Another daemon for managing control groups
      
Another daemon for managing control groups
      
I haven't seen any indications of that.
Yeah, sure. Without any new features.
           