{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/368","labels_url":"https://api.github.com/repos/systemd/systemd/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/368/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/368/events","html_url":"https://github.com/systemd/systemd/pull/368","id":90979760,"number":368,"title":"Simple unified cgroups rework","user":{"login":"xnox","id":19779,"avatar_url":"https://avatars.githubusercontent.com/u/19779?v=3","gravatar_id":"","url":"https://api.github.com/users/xnox","html_url":"https://github.com/xnox","followers_url":"https://api.github.com/users/xnox/followers","following_url":"https://api.github.com/users/xnox/following{/other_user}","gists_url":"https://api.github.com/users/xnox/gists{/gist_id}","starred_url":"https://api.github.com/users/xnox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnox/subscriptions","organizations_url":"https://api.github.com/users/xnox/orgs","repos_url":"https://api.github.com/users/xnox/repos","events_url":"https://api.github.com/users/xnox/events{/privacy}","received_events_url":"https://api.github.com/users/xnox/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemd/systemd/labels/cgroups","name":"cgroups","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-25T14:25:41Z","updated_at":"2015-06-25T17:08:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/368","html_url":"https://github.com/systemd/systemd/pull/368","diff_url":"https://github.com/systemd/systemd/pull/368.diff","patch_url":"https://github.com/systemd/systemd/pull/368.patch"},"body":"This is a new take at basic, highly experimental, unified cgroup support.\r\n\r\nIt's a runtime option, if one passes \"systemd.unified-cgroup=1\" on the kernel command line, some of the unified cgroups structures will be used. Specifically a unified cgroup structure will be mounted at /sys/fs/cgroup/systemd (for now) instead of a \"name=systemd\" cgroup. And instead of cgroup agent notifications, inotify watches are used.\r\n\r\nThe patch series is split in three simple(ish) commits.\r\n\r\n1) unified cgroup is exposed as \"0:<controllers>:\" in /proc/self/cgroup, where controllers may be empty (that is the case if _all_ controllers are mounted as legacy). Hence an adjustemt needs to be made for \"name=systemd\" controller queries, as they are now can be satisfied with 0:: entry in /proc/self/cgroup.\r\n\r\n2) in mount-setup.c i add a conditional mount of unified hierarchy at /sys/fs/cgroup/systemd. This is the best option for now, to experiment and work on supporting unified features on both old/new hosts/guests containers etc. Since mount-setup mounts proc, i have to parce the kernel command line inline once mount_setup gets to mounting the mandatory cgroup.\r\n\r\n3) is the largest patch, and it add an inotify fd, and then adds cgroup.populated watches on the cgroup.populated attribute whenever new cgroups are created. This is roughly similar to other code else where, a hashmap is used to map units to watch with wd and then notifications similar to the current dbus notification are done. Unlike dbus notification, inotify notification is not marshalled, nor retransmitted. This could be added if desired.\r\n\r\nIn terms of todo, next step is to support e.g. mem.max instead of mem.limit_in_bytes. Mem seems to be the only controller that is \"converted\" to support unified cgroup hierchy (since in the kernel it declares .dfl_cftypes & .legacy_cftypes).\r\n\r\nAnother thing we could do is force mount all controller together, especially when cgroup__DEVEL__legacy_files_on_dfl is passed on the kernel cmdline."},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/115325607","html_url":"https://github.com/systemd/systemd/pull/368#issuecomment-115325607","issue_url":"https://api.github.com/repos/systemd/systemd/issues/368","id":115325607,"user":{"login":"xnox","id":19779,"avatar_url":"https://avatars.githubusercontent.com/u/19779?v=3","gravatar_id":"","url":"https://api.github.com/users/xnox","html_url":"https://github.com/xnox","followers_url":"https://api.github.com/users/xnox/followers","following_url":"https://api.github.com/users/xnox/following{/other_user}","gists_url":"https://api.github.com/users/xnox/gists{/gist_id}","starred_url":"https://api.github.com/users/xnox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnox/subscriptions","organizations_url":"https://api.github.com/users/xnox/orgs","repos_url":"https://api.github.com/users/xnox/repos","events_url":"https://api.github.com/users/xnox/events{/privacy}","received_events_url":"https://api.github.com/users/xnox/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T17:08:42Z","updated_at":"2015-06-25T17:08:42Z","body":"Previous incarnation was pull request #7 "}}