Find a file
Zbigniew Jędrzejewski-Szmek 519ae503e3 sd-bus: drop bytefield annontations
It's the same old story: 'struct sd_bus' is generally instantiated once, so
bitfields, for which we pay with more complicated code in all users of this
struct, are counterproductive. In some progs the structure may be instantiated
a few times, but it's still not worth it because we save a few bytes of memory
in one place and pay for this with many more bytes in the code.

$ size build/libsystemd.so.0.39.0{.orig,}
   text	   data	    bss	    dec	    hex	filename
2452757	  65376	   3768	2521901	 267b2d	build/libsystemd.so.0.39.0.orig
2451669	  65376	   3768	2520813	 2676ed	build/libsystemd.so.0.39.0

$ diff -u <(pahole build/libsystemd.so.0.39.0.orig) <(pahole build/libsystemd.so.0.39.0)
...
-       /* size: 1960, cachelines: 31, members: 105 */
-       /* sum members: 1944, holes: 3, sum holes: 9 */
-       /* sum bitfield members: 25 bits, bit holes: 2, sum bit holes: 31 bits */
+       /* size: 1984, cachelines: 31, members: 105 */
+       /* sum members: 1971, holes: 4, sum holes: 13 */
        /* member types with holes: 1, total: 1 */

i.e. 2452757 - 2451669 = 1088 extra bytes of code and slower execution, to save
24 bytes of memory per instance of the struct. (But the number of cachelines
doesn't change, so the smaller struct most likely has no effect on memory
access, and the alignment of the struct most likely means that the memory
saving is illusory too, we just end up with a few bytes of padding after the
struct.)

In the other structs, the alignment prevent the bitfield for having any effect
on memory use, but the compiler would still generate more complicated code,
i.e. we pay something for nothing.

For example:

$ diff -u <(pahole build/libsystemd.so.0.39.0.orig) <(pahole build/libsystemd.so.0.39.0)
...
 struct node_callback {
        struct node *              node;                 /*     0     8 */
-       _Bool                      is_fallback:1;        /*     8: 0  1 */
+       _Bool                      is_fallback;          /*     8     1 */

-       /* XXX 7 bits hole, try to pack */
        /* XXX 3 bytes hole, try to pack */

        unsigned int               last_iteration;       /*    12     4 */
@@ -455,15 +448,13 @@
        struct node_callback *     callbacks_prev;       /*    32     8 */

        /* size: 40, cachelines: 1, members: 6 */
-       /* sum members: 36, holes: 1, sum holes: 3 */
-       /* sum bitfield members: 1 bits, bit holes: 1, sum bit holes: 7 bits */
+       /* sum members: 37, holes: 1, sum holes: 3 */
        /* last cacheline: 40 bytes */
 };

I kept the bitfield in sd_bus_slot because it prevents the struct from growing
from 112 to 120 bytes by reducing the alignment requirement for subsequent
fields, and we potentially can have this instantiated many times.
2024-06-28 12:11:02 +02:00
.clusterfuzzlite
.github mkosi: bump to latest commit 2024-06-26 15:47:13 +01:00
.semaphore semaphore: use variable for Salsa repo URL 2024-05-20 13:14:50 +01:00
catalog login: Add a new SecureAttentionKey dbus signal when Ctrl+Alt+Shift+Esc is pressed 2024-06-24 22:29:38 +02:00
coccinelle introduce FOREACH_ELEMENT 2024-04-18 17:39:34 +02:00
docs docs: fix dead link to GNOME documentation 2024-06-28 09:39:56 +02:00
factory
hwdb.d hwdb: fix keyboard of RedmiBook Pro 15 2022 (#33465) 2024-06-25 03:22:37 +09:00
LICENSES tree-wide: drop several remaining license headers 2024-04-08 10:14:50 +02:00
man man/tmpfiles: remove outdated behavior regarding symlink ownership 2024-06-27 18:24:07 +02:00
mime creds-util: add a concept of "user-scoped" credentials 2024-01-30 17:07:47 +01:00
mkosi.conf.d mkosi: Enable hyperscale-packages-experimental for CentOS 2024-06-27 12:50:41 +02:00
mkosi.images mkosi: move variable to the right scope 2024-06-28 11:48:25 +02:00
mkosi.profiles mkosi: Introduce particle profile 2024-04-30 10:46:18 +02:00
modprobe.d
network Reapply "network: add "mac" to alternatives name policy by default" 2024-06-12 18:05:09 +02:00
pkg mkosi: Replace submodules with our own thing 2024-05-30 19:31:32 +02:00
po po: update and correction translation (Chinese (Traditional) (zh_TW)) 2024-06-06 09:55:26 +09:00
presets presets: Don't enable systemd-homed-firstboot.service by default 2024-06-08 11:29:55 +01:00
rules.d udev: tag MTD devices for systemd 2024-06-12 00:18:33 +01:00
shell-completion cryptenroll: support for enrolling FIDO2 tokens in manual mode 2024-06-20 14:26:24 +02:00
src sd-bus: drop bytefield annontations 2024-06-28 12:11:02 +02:00
sysctl.d
sysusers.d sysusers: simplify meson config 2024-05-14 20:46:24 +02:00
test TEST-58-REPART: reverse order of diff args 2024-06-28 11:48:25 +02:00
tmpfiles.d meson: don't put a symlink pointing to '20-systemd-userdb.conf' in /etc in all cases 2024-05-27 17:20:55 +02:00
tools Merge pull request #33214 from keszybz/system-clock-epoch 2024-06-16 17:42:47 +02:00
units importd: allow activation in early boot, and make it socket activatable 2024-06-25 09:57:42 +02:00
xorg
.clang-format Improve the formatting by adding AlignArrayOfStructures and setting it to Right(right justify) 2024-03-06 15:24:23 +01:00
.ctags
.dir-locals.el
.editorconfig
.gitattributes
.gitignore gitignore: Ignore /pkg/ instead of pkg/ (#33119) 2024-05-31 14:06:07 +08:00
.gitmodules mkosi: Replace submodules with our own thing 2024-05-30 19:31:32 +02:00
.mailmap
.packit.yml Revert "packit: temporarily build systemd without BPF stuff" 2024-02-11 16:45:03 +01:00
.pylintrc
.vimrc
.ycm_extra_conf.py
LICENSE.GPL2
LICENSE.LGPL2.1
meson.build meson: Drop genkey target 2024-06-28 10:20:10 +02:00
meson.version meson: update version to 257~devel 2024-06-11 22:55:29 +01:00
meson_options.txt test: Add mkosi-based integration test runner 2024-04-18 16:26:38 +01:00
mkosi.conf ci: Switch to Ubuntu 24.04 2024-06-08 12:33:32 +02:00
NEWS NEWS: fix typo 2024-06-18 18:04:09 +09:00
README README: update link for backports 2024-05-28 14:48:56 +02:00
README.md README.md: link bug bounty program 2024-04-11 12:58:53 +02:00
TODO update TODO 2024-06-28 10:15:53 +02:00

Systemd

System and Service Manager

Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
CentOS CI - CentOS 9
CentOS CI - Arch
CentOS CI - Arch (sanitizers)
Fossies codespell report
Weblate
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel

Stable branches with backported patches are available in the stable repo.

We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack