Ninjatrappeur's systemd working tree
Go to file
Lennart Poettering efdb02375b core: unified cgroup hierarchy support
This patch set adds full support the new unified cgroup hierarchy logic
of modern kernels.

A new kernel command line option "systemd.unified_cgroup_hierarchy=1" is
added. If specified the unified hierarchy is mounted to /sys/fs/cgroup
instead of a tmpfs. No further hierarchies are mounted. The kernel
command line option defaults to off. We can turn it on by default as
soon as the kernel's APIs regarding this are stabilized (but even then
downstream distros might want to turn this off, as this will break any
tools that access cgroupfs directly).

It is possibly to choose for each boot individually whether the unified
or the legacy hierarchy is used. nspawn will by default provide the
legacy hierarchy to containers if the host is using it, and the unified
otherwise. However it is possible to run containers with the unified
hierarchy on a legacy host and vice versa, by setting the
$UNIFIED_CGROUP_HIERARCHY environment variable for nspawn to 1 or 0,
respectively.

The unified hierarchy provides reliable cgroup empty notifications for
the first time, via inotify. To make use of this we maintain one
manager-wide inotify fd, and each cgroup to it.

This patch also removes cg_delete() which is unused now.

On kernel 4.2 only the "memory" controller is compatible with the
unified hierarchy, hence that's the only controller systemd exposes when
booted in unified heirarchy mode.

This introduces a new enum for enumerating supported controllers, plus a
related enum for the mask bits mapping to it. The core is changed to
make use of this everywhere.

This moves PID 1 into a new "init.scope" implicit scope unit in the root
slice. This is necessary since on the unified hierarchy cgroups may
either contain subgroups or processes but not both. PID 1 hence has to
move out of the root cgroup (strictly speaking the root cgroup is the
only one where processes and subgroups are still allowed, but in order
to support containers nicey, we move PID 1 into the new scope in all
cases.) This new unit is also used on legacy hierarchy setups. It's
actually pretty useful on all systems, as it can then be used to filter
journal messages coming from PID 1, and so on.

The root slice ("-.slice") is now implicitly created and started (and
does not require a unit file on disk anymore), since
that's where "init.scope" is located and the slice needs to be started
before the scope can.

To check whether we are in unified or legacy hierarchy mode we use
statfs() on /sys/fs/cgroup. If the .f_type field reports tmpfs we are in
legacy mode, if it reports cgroupfs we are in unified mode.

This patch set carefuly makes sure that cgls and cgtop continue to work
as desired.

When invoking nspawn as a service it will implicitly create two
subcgroups in the cgroup it is using, one to move the nspawn process
into, the other to move the actual container processes into. This is
done because of the requirement that cgroups may either contain
processes or other subgroups.
2015-09-01 23:52:27 +02:00
catalog l10n: Add Belarusian translation 2015-06-15 00:13:43 +03:00
docs docs: add .gitignore 2015-07-06 17:47:38 +02:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: move the Performance MX to 1000dpi 2015-08-31 14:53:07 +10:00
m4 build-sys: Look for gcc-* binutils wrappers only if we're using GCC 2015-09-01 13:27:42 +02:00
man Merge pull request #1109 from phomes/man-typos 2015-09-01 19:08:55 +02:00
network networkd: emit DNS/NTP/Timezone info via DHCP server by default 2015-08-27 16:47:26 +02:00
po po: update Polish translation 2015-08-29 20:33:02 +02:00
rules UML: Fix block device setup 2015-08-09 18:07:55 +02:00
shell-completion run: enable interactive authorization 2015-09-01 16:43:08 +00:00
src core: unified cgroup hierarchy support 2015-09-01 23:52:27 +02:00
sysctl.d sysctl: add some hints how to override settings 2015-02-26 19:07:38 -05:00
system-preset preset: enable machines.target by default 2014-12-29 17:36:57 +01:00
sysusers.d turn kdbus support into a runtime option 2015-06-17 18:01:49 +02:00
test test: udev - Signal that test was skipped when running as non-root 2015-08-30 22:10:30 -07:00
tmpfiles.d tmpfiles: don't recursively descend into journal directories in /var 2015-07-09 18:46:01 -03:00
tools terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
units bus-proxy: add ExecReload= 2015-08-04 13:19:50 +02:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el Keep emacs configuration in one configuration file. 2011-03-08 01:53:46 +01:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore Merge branch 'hostnamectl-dot-v2' 2015-08-05 21:02:41 -04:00
.mailmap prepare NEWS 2014-02-18 02:51:47 +01:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: disable -fdiagnostics-color output 2013-10-20 04:29:39 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
CODING_STYLE CODING_STYLE: say that "for (;;)" is better than "while (1)" 2015-07-31 20:00:07 +02:00
DISTRO_PORTING build-sys: warn if people don't change the default NTP servers when building systemd 2015-07-11 14:24:29 -03:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile-man.am man: document nss-resolve 2015-08-26 11:00:09 +02:00
Makefile.am Merge pull request #1055 from poettering/dhcp-updates 2015-08-27 21:38:36 +02:00
NEWS NEWS: update 2015-08-27 17:03:18 +02:00
README README: drop reference to Endocode 2015-08-16 21:06:42 +02:00
README.md README.md: add Coverity scan status badge 2015-06-08 13:26:54 +02:00
TODO update TODO 2015-08-31 13:09:29 +02:00
autogen.sh terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
configure.ac build-sys: Look for gcc-* binutils wrappers only if we're using GCC 2015-09-01 13:27:42 +02:00

README.md

systemd - System and Service Manager

Build Status
Coverity Scan Status

Details

  • General information about systemd can be found in the systemd Wiki
  • Information about build requirements are provided in the README file