Systemd/src
Michal Schmidt 7d17cfbc46 unit: reduce heap usage for unit objects
The storage of the unit objects on the heap is currently not very
efficient. For every unit object we allocate a chunk of memory as large
as the biggest unit type, although there are significant differences in
the units' real requirements.
pahole shows the following sizes of structs:
488  Target
496  Snapshot
512  Device
528  Path
560  Timer
576  Automount
1080 Socket
1160 Swap
1168 Service
1280 Mount

Usually there aren't many targets or snapshots in the system, but Device
is one of the most common unit types and for every one we waste
1280 - 512 = 768 bytes.

Fix it by allocating only the right amount for the given unit type.
On my machine (x86_64, with 39 LVM volumes) this decreases systemd's
USS (unique set size) by more than 300 KB.
2012-01-16 13:34:42 +01:00
..
binfmt build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
cryptsetup core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
hostname build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
journal journal: drop privileges when storing coredump 2012-01-14 03:37:32 +01:00
linux build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
locale build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
login logind: downgrade login message to debug 2012-01-16 13:18:17 +01:00
readahead core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
systemd journal: hook up coredumping with journal 2012-01-14 01:54:33 +01:00
timedate build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
vconsole build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
.gitignore journal: hook up coredumping with journal 2012-01-14 01:54:33 +01:00
70-uaccess.rules logind: implement D-Bus properties 2011-06-21 19:29:44 +02:00
71-seat.rules seat: add another 'Plugable' device id 2011-07-25 14:35:33 +02:00
73-seat-late.rules.in acl: properly handle if devices are tagged as uaccess but do not have a device node 2011-08-25 16:50:49 +02:00
99-systemd.rules.in udev: exclude loopback device from udev rule based sysctl application, since we can just apply that directly at boot 2011-12-27 22:52:15 +01:00
ac-power.c
acl-util.c journal: split user logs into their own journal files 2011-10-07 23:03:07 +02:00
acl-util.h journal: split user logs into their own journal files 2011-10-07 23:03:07 +02:00
ask-password-api.c util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
ask-password-api.h ask-password: supported plymouth cached passwords 2011-02-23 01:12:07 +01:00
ask-password.c ask-password: use default timeout 2011-04-16 02:03:34 +02:00
automount.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
automount.h unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
bridge.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
build.h
bus-errors.h
cgls.c systemctl: hide all information on --kill-mode= since it is mostly useless 2011-07-07 04:19:03 +02:00
cgroup-attr.c exec: optionally apply cgroup attributes to the cgroups we create 2011-08-20 00:22:02 +02:00
cgroup-attr.h exec: optionally apply cgroup attributes to the cgroups we create 2011-08-20 00:22:02 +02:00
cgroup-show.c journal: add preliminary incomplete implementation 2011-10-07 22:02:05 +02:00
cgroup-show.h
cgroup-util.c cgroup: optionally mount a specific cgroup controllers together, and add cpu+cpuacct to the default 2011-08-23 00:37:35 +02:00
cgroup-util.h cgroup: honour sticky bit when trimming cgroup trees 2011-08-21 20:07:46 +02:00
cgroup.c service: brutally slaughter processes that are running in the cgroup when we enter START_PRE and START 2012-01-11 02:52:34 +01:00
cgroup.h exec: add ControlGroupModify= switch to allow changing access mode to cgroups fs 2011-06-30 00:11:25 +02:00
cgroups-agent.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
condition.c condition: Fix file descriptor leak in test_capability() 2011-11-01 17:02:32 +01:00
condition.h unit: introduce ConditionCapability 2011-10-11 15:16:52 +02:00
conf-parser.c conf-parser: silence compiler warning 2012-01-05 00:46:55 +01:00
conf-parser.h journald: parse configuration file 2012-01-04 20:40:04 +01:00
dbus-automount.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-automount.h
dbus-common.c dbus: terminate mechanism daemons after a while 2011-09-03 03:26:58 +02:00
dbus-common.h dbus: terminate mechanism daemons after a while 2011-09-03 03:26:58 +02:00
dbus-device.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-device.h
dbus-execute.c execute: fix bus serialization for commands 2011-08-29 19:45:46 +02:00
dbus-execute.h exec: introduce PrivateNetwork= process option to turn off network access to specific services 2011-08-02 05:24:58 +02:00
dbus-job.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-job.h dbus: pass along information why a job failed when it failed (dbus api change!) 2011-02-24 02:36:34 +01:00
dbus-loop.c logind: first version that compiles fine 2011-06-21 19:29:44 +02:00
dbus-loop.h logind: first version that compiles fine 2011-06-21 19:29:44 +02:00
dbus-manager.c coverity: change a few things so that coverity doesn't show so many false positives 2011-09-23 01:45:34 +02:00
dbus-manager.h
dbus-mount.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-mount.h
dbus-path.c unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
dbus-path.h
dbus-service.c unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
dbus-service.h
dbus-snapshot.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-snapshot.h
dbus-socket.c socket: rename the PassCred= option to PassCredentials=, since we don't want to needlessly abbreviate options unless they are very well established 2011-12-31 01:07:49 +01:00
dbus-socket.h
dbus-swap.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-swap.h
dbus-target.c dbus: split out object management code into dbus-common, and simplify it 2011-04-16 02:03:35 +02:00
dbus-target.h
dbus-timer.c unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
dbus-timer.h
dbus-unit.c cgroup: expose cgroup attributes as unit properties on the bus 2011-08-21 20:07:08 +02:00
dbus-unit.h unit: implement new PropagateReloadTo=/PropagateReloadFrom= operations 2012-01-11 02:52:34 +01:00
dbus.c dbus: no sync D-Bus connection flushing 2011-12-20 00:23:51 +01:00
dbus.h dbus: send our finished signal when we are finished booting 2011-06-27 13:47:03 +02:00
def.h def: lower default timeout to 90s 2011-04-27 22:30:50 +02:00
detect-virt.c util: move virtualization detection into its own files, and extend return codes 2011-09-23 17:00:33 +02:00
device.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
device.h Spelling Corrections 2011-02-28 22:47:38 +01:00
execute.c journal: introduce log target 'journal' for executed processes 2012-01-06 02:48:38 +01:00
execute.h journal: introduce log target 'journal' for executed processes 2012-01-06 02:48:38 +01:00
exit-status.c execute: log errors from "sd(EXEC)" 2011-11-17 01:36:11 +01:00
exit-status.h execute: log errors from "sd(EXEC)" 2011-11-17 01:36:11 +01:00
fdset.c manager: merge serialization and desrialization counter into one, and increase it when reexecuting 2011-07-06 00:47:42 +02:00
fdset.h
fsck.c fsck: Fix typo in comment 2011-12-15 18:48:15 +01:00
getty-generator.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
gnome-ask-password-agent.vala gnome-ask-password-agent: require libnotify >= 0.7.0 2011-12-31 18:15:27 +01:00
hashmap.c hashmap: add hashmap_first_key() 2011-12-19 19:54:51 +01:00
hashmap.h hashmap: add hashmap_first_key() 2011-12-19 19:54:51 +01:00
hostname-setup.c Add Mageia support 2011-11-02 02:16:39 +01:00
hostname-setup.h
initctl.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
initreq.h
install.c Allow 'list-unit-files' to run with --root. 2011-12-05 22:04:42 +01:00
install.h bus: expose installer functions 2011-07-23 03:44:47 +02:00
ioprio.h
job.c util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
job.h job: fix deserialization of jobs: do not ignore ordering 2011-04-06 19:09:33 +02:00
kmod-setup.c exec: optionally apply cgroup attributes to the cgroups we create 2011-08-20 00:22:02 +02:00
kmod-setup.h
label.c label: fix labeling of symbolic links 2011-12-19 23:58:58 +01:00
label.h label: introduce label_bind() and make use of it where necessary 2011-08-31 01:02:00 +02:00
libsystemd-daemon.pc.in build-sys: move .pc files next to the matching sources 2012-01-07 01:36:36 +01:00
libsystemd-daemon.sym libs: add symbol versioning for the benefit of RPM 2011-07-14 23:49:37 +02:00
libsystemd-id128.pc.in build-sys: move .pc files next to the matching sources 2012-01-07 01:36:36 +01:00
libsystemd-id128.sym sd-id128: let's make our API a bit smaller, since sd_id128_make_v4_uuid() is dispensable 2012-01-07 01:37:39 +01:00
list.h
load-dropin.c dropin: don't fail if random files are stored in .wants directories 2011-08-31 03:55:38 +02:00
load-dropin.h
load-fragment-gperf.gperf.m4 unit: implement new PropagateReloadTo=/PropagateReloadFrom= operations 2012-01-11 02:52:34 +01:00
load-fragment.c load-fragment: fix parsing of Socket= setting 2012-01-07 01:26:08 +01:00
load-fragment.h exec: add high-level controls for blkio cgroup attributes 2011-08-21 20:07:08 +02:00
locale-setup.c Add Mageia support 2011-11-02 02:16:39 +01:00
locale-setup.h
log.c util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
log.h log: make internal log api log directly to the journal 2012-01-12 04:34:31 +01:00
logs-show.c journal: when show blob data show length 2012-01-14 03:07:47 +01:00
logs-show.h journal: add output mode that just prints simple messages without any decorations 2012-01-13 02:58:45 +01:00
loopback-setup.c loopback: downgrade an error to warning 2011-03-16 03:35:38 +01:00
loopback-setup.h
machine-id-main.c main: introduce /etc/machine-id 2011-03-04 21:53:19 +01:00
machine-id-setup.c build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
machine-id-setup.h main: introduce /etc/machine-id 2011-03-04 21:53:19 +01:00
macro.h macro: fix ALIGN_TO macro definition 2011-11-08 18:18:48 +01:00
main.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
Makefile
manager.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
manager.h core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
missing.h missing: define gettid() 2011-08-01 05:06:15 +02:00
modules-load.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
mount-setup.c selinux: explicitly relabel /run/initramfs/root-fsck and friends 2011-08-30 18:49:41 +02:00
mount-setup.h cgroup: optionally mount a specific cgroup controllers together, and add cpu+cpuacct to the default 2011-08-23 00:37:35 +02:00
mount.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
mount.h service: when reloading a service fails don't fail the entire service but just the reload job 2011-01-20 13:17:22 +01:00
namespace.c namespace: remount namespace root dir for SLAVE to avoid propagation of mounts from the namespace to the host 2012-01-03 21:12:10 +01:00
namespace.h
notify.c build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
nspawn.c build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
org.freedesktop.systemd1.conf systemctl: hook up new install logic 2011-07-25 04:58:02 +02:00
org.freedesktop.systemd1.policy.in.in build-sys: fix make distcheck 2011-07-12 01:11:40 +02:00
org.freedesktop.systemd1.service
pager.c pager: add _noreturn_ to pager_fallback() 2011-10-11 15:41:32 +02:00
pager.h cgls: add pager support to systemd-cgls 2011-07-07 02:34:35 +02:00
path-lookup.c path-lookup: monitor /etc/systemd/user for user manager 2011-08-24 14:08:56 +02:00
path-lookup.h path-lookup: make inclusion of user private units optional 2011-07-22 04:31:20 +02:00
path.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
path.h unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
polkit.c mechanisms: add mechanisms to change system locale and clock 2011-06-21 19:29:45 +02:00
polkit.h mechanisms: add mechanisms to change system locale and clock 2011-06-21 19:29:45 +02:00
quotacheck.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
random-seed.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
ratelimit.c ratelimit: removed n_printed 2011-02-28 23:04:18 +01:00
ratelimit.h ratelimit: removed n_printed 2011-02-28 23:04:18 +01:00
rc-local-generator.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
remount-api-vfs.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
reply-password.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
sd-daemon.c sd-daemon: turn sd-daemon.c into a shared library 2011-07-14 23:06:31 +02:00
sd-id128.c sd-id128: let's make our API a bit smaller, since sd_id128_make_v4_uuid() is dispensable 2012-01-07 01:37:39 +01:00
securebits.h Spelling Corrections 2011-02-28 22:47:38 +01:00
selinux-setup.c selinux: reopen log when loading the SELinux policy fails 2011-09-22 04:05:40 +02:00
selinux-setup.h selinux: use setcon() instead of reexec to apply selinux policy 2011-07-28 23:52:23 +02:00
service.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
service.h unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
set.c
set.h
shutdown.c shutdown: add link to root storage daemon text 2012-01-11 02:52:34 +01:00
shutdownd.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
shutdownd.h shutdown: respect the dry run option '-k' 2011-07-03 00:12:16 +02:00
snapshot.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
snapshot.h
socket-util.c label: introduce label_bind() and make use of it where necessary 2011-08-31 01:02:00 +02:00
socket-util.h socket: expose IP_TRANSPARENT 2011-05-19 13:22:31 +02:00
socket.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
socket.h unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
spawn-agent.c systemctl: hook up new install logic 2011-07-25 04:58:02 +02:00
spawn-agent.h systemctl: hook up new install logic 2011-07-25 04:58:02 +02:00
special.h systemd: reconnect to syslog as soon as the journal is fully up 2012-01-11 03:16:24 +01:00
specifier.c specifier: drop misplaced assert() 2011-08-30 16:49:48 +02:00
specifier.h
strv.c coverity: change a few things so that coverity doesn't show so many false positives 2011-09-23 01:45:34 +02:00
strv.h cgroup: optionally mount a specific cgroup controllers together, and add cpu+cpuacct to the default 2011-08-23 00:37:35 +02:00
swap.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
swap.h Spelling Corrections 2011-02-28 22:47:38 +01:00
sysctl.c umask: change default umask to 0022 just to be sure, and set it explicitly in all binaries, in order to make sure it is set when started from the terminal 2011-08-01 20:52:18 +02:00
sysfs-show.c llvm-analyze: change a few things to make llvm-analyze show fewer false positives 2011-09-23 16:28:27 +02:00
sysfs-show.h loginctl: add missing header file 2011-07-09 00:04:27 +02:00
system.conf core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
systemadm.vala systemadm: use colors for id too, remove color from fragment link 2011-09-20 01:07:28 +02:00
systemctl.c util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
systemd-analyze analyze: always draw top kernel, initramfs, userspace bars 2011-09-27 12:57:28 +02:00
systemd-bash-completion.sh bash-completion: rename file since it is no longer for systemctl only 2011-11-02 13:07:47 +01:00
systemd-interfaces.vala dbus: pass along information why a job failed when it failed (dbus api change!) 2011-02-24 02:36:34 +01:00
systemd.pc.in build-sys: move .pc files next to the matching sources 2012-01-07 01:36:36 +01:00
target.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
target.h
tcpwrap.c
tcpwrap.h
test-cgroup.c kill: always send SIGCONT after SIGTERM 2011-03-03 23:55:30 +01:00
test-daemon.c build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
test-engine.c test: rename test directory 2011-12-31 18:06:56 +01:00
test-env-replace.c ask-password: supported plymouth cached passwords 2011-02-23 01:12:07 +01:00
test-hostname.c
test-id128.c build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
test-install.c install: add new installer implementation 2011-07-22 04:31:21 +02:00
test-job-type.c Spelling Corrections 2011-02-28 22:47:38 +01:00
test-loopback.c
test-ns.c
test-strv.c specifier: at minimal test 2011-01-06 23:51:52 +01:00
timer.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
timer.h unit: properly update references to units which are merged 2012-01-06 23:08:54 +01:00
timestamp.c
tmpfiles.c tmpfiles: fix parsing of /proc/net/unix on 32Bit machines 2012-01-11 22:08:33 +01:00
tty-ask-password-agent.c plymouth: fix ply proto endianess issues 2011-11-01 14:20:31 +01:00
umount.c llvm-analyze: change a few things to make llvm-analyze show fewer false positives 2011-09-23 16:28:27 +02:00
umount.h
unit-name.c util: various optimizations, using join() 2011-08-01 01:55:31 +02:00
unit-name.h
unit.c unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
unit.h unit: reduce heap usage for unit objects 2012-01-16 13:34:42 +01:00
update-utmp.c core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
user.conf logind: add man page for configuration file 2011-06-29 02:27:53 +02:00
util.c util: support formatting eta and peta bytes with format_bytes() 2012-01-14 03:07:29 +01:00
util.h util: introduce FORMAT_BYTES_MAX 2012-01-14 03:06:57 +01:00
utmp-wtmp.c utmp: for DEAD_PROCESS write the current time to wtmp 2011-11-07 01:10:35 +01:00
utmp-wtmp.h utmp: remove unneded parameters 2011-11-07 01:09:53 +01:00
virt.c util: move virtualization detection into its own files, and extend return codes 2011-09-23 17:00:33 +02:00
virt.h util: move virtualization detection into its own files, and extend return codes 2011-09-23 17:00:33 +02:00
wraplabel.vala systemadm: add a wrappable label and use it for status lines 2011-09-20 01:06:01 +02:00