Measure and slim down systemd and udev


 * Summary: Measure and slim down systemd and udev


 * Proposer: Gustavo Sverzut Barbieri 

Description
Systemd is a system and service manager for Linux featuring aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysvinit.

Udev is the device manager for the Linux kernel, receiving hotplug events, firmware load requests, dynamically loading modules and so on. Udev and systemd communicates heavily and can boost each other capabilities, such as properly assigning labels and users to hardware, starting services when devices are found, among others. Due this, udev and systemd merged into a single project to highly simplify the project interaction and share codebase.

Both projects have a great potential to simplify and speed up the Linux boot process, yet they are claimed to be heavyweight for embedded system without a clear reason or numbers, just speculations.

The first part of this project is to measure the impact of both systemd and udev in a system compared to the said smallest stack up to date: busybox init and mdev. The comparison should account, for each component, disk footprint, runtime memory and features. Systemd should have always two measures: the default (full-feature) and stripped. The stripped version will include no extras such as ACL, audit, tcpwrap or logind. The comparison should also highlight features of each measured component. The result of this work is a clear view of the systemd and udev impact compared to a barebone solution, with concrete numbers.

The second part of this project is to slim down both systemd and udev based on findings of the measurements. Although already configurable to some degree, both systemd and udev should receive more compile time options to cope with embedded systems. The developers already agreed to accept such options if they prove to be worth and our numbers from the first part of this project are important here.

The key features of systemd to be analysed and, if proven to be heavy, slimmed down are:
 * journald to be made optional, with logs going to /dev/kmsg;
 * cgroups usage to be made optional, loosing all grouping and isolation it allows;
 * dbus usage to be made optional, removing the runtime management with systemctl.
 * internal structures and state.

The last part of this project is to write a document on systemd targeted at embedded systems and clarifying what parts can be disabled and their effect. It already comes with 28 binaries that can be optionally removed and a handful of features that can be disabled.

Related work

 * http://www.freedesktop.org/wiki/Software/systemd
 * http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html

Scope
Total: 6-14 person-weeks
 * 1) Measure systemd and udev compared to busybox init and mdev: 1 person-week
 * 2) Slim down systemd and udev based on measured numbers: 4-12 person-weeks (can be time-based instead of feature/size based)
 * 3) Document systemd and udev for embedded systems and how slim them: 1 person-week

Contractor Candidates
Gustavo Sverzut Barbieri  (or co-workers from ProFUSION embedded systems)