1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00
Backports of patch from systemd git to stable distributions
Go to file
Lennart Poettering 1b3f9dd759 bus-message: introduce two kinds of references to bus messages
Before this commit bus messages had a single reference count: when it
reached zero the message would be freed. This simple approach meant a
cyclic dependency was typically seen: a message that was enqueued in a
bus connection object would reference the bus connection object but also
itself be referenced by the bus connection object. So far out strategy
to avoid cases like this was: make sure to process the bus connection
regularly so that messages don#t stay queued, and at exit flush/close
the connection so that the message queued would be emptied, and thus the
cyclic dependencies resolved. Im many cases this isn't done properly
however.

With this change, let's address the issue more systematically: let's
break the reference cycle. Specifically, there are now two types of
references to a bus message:

1. A regular one, which keeps both the message and the bus object it is
   associated with pinned.

2. A "queue" reference, which is weaker: it pins the message, but not
   the bus object it is associated with.

The idea is then that regular user handling uses regular references, but
when a message is enqueued on its connection, then this takes a "queue"
reference instead. This then means that a queued message doesn't imply
the connection itself remains pinned, only regular references to the
connection or a message associated with it do. Thus, if we end up in the
situation where a user allocates a bus and a message and enqueues the
latter in the former and drops all refs to both, then this will detect
this case and free both.

Note that this scheme isn't perfect, it only covers references between
messages and the busses they are associated with. If OTOH a bus message
is enqueued on a different bus than it is associated with cyclic deps
cannot be recognized with this simple algorithm, and thus if you enqueue
a message associated with a bus A on a bus B, and another message
associated with bus B on a bus A, a cyclic ref will be in effect and not
be discovered. However, given that this is an exotic case (though one
that happens, consider systemd-bus-stdio-bridge), it should be OK not to
cover with this, and people have to explicit flush all queues on exit in
that case.

Note that this commit only establishes the separate reference counters
per message. A follow-up commit will start making use of this from the
bus connection object.
2019-03-01 15:37:39 +01:00
.github/ISSUE_TEMPLATE docs: move markdown docs from .github/ to docs/ 2018-09-08 13:39:03 -07:00
.lgtm/cpp-queries lgtm: drop redundant newlines 2018-10-26 14:52:17 +02:00
.mkosi mkosi: (Archlinux) increase the size of root partition. 2019-02-22 19:53:27 +09:00
catalog catalog: update Polish translation 2018-11-19 09:23:04 +01:00
coccinelle tree-wide: more IOVEC_MAKE() conversions 2018-11-28 13:08:19 +09:00
docs docs: enclose all uuids in `` 2019-03-01 12:41:32 +01:00
factory/etc man,factory: update factory config for nsswitch.conf to match the man pages 2018-11-27 22:35:02 +01:00
hwdb hwdb: Add accelerometer orientation quirk for the Medion Akoya E2212T 2019-02-21 16:40:51 +01:00
man man: document XBOOTLDR partition logic in bootctl's man page 2019-03-01 12:41:32 +01:00
modprobe.d Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
network link-config: add "keep" policy and use it by default 2019-01-17 13:56:02 +01:00
po Update uk.po 2019-01-15 14:37:50 +01:00
presets Drop my copyright headers 2018-06-14 13:03:20 +02:00
rules units: add usb-gadget target 2019-02-15 18:16:27 +01:00
semaphoreci semaphoreci: Run subset of autopkgtests in LXC (#11814) 2019-03-01 10:01:09 +01:00
shell-completion journalctl: New option --cursor-file 2019-02-27 18:43:31 +01:00
src bus-message: introduce two kinds of references to bus messages 2019-03-01 15:37:39 +01:00
sysctl.d Enable regular file and FIFO protection 2019-01-16 12:22:01 +01:00
sysusers.d sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync 2018-07-16 17:11:50 +02:00
test Merge pull request #11834 from martinpitt/network-test-fixes 2019-02-28 17:48:41 +01:00
tmpfiles.d sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync 2018-07-16 17:11:50 +02:00
tools tools: check all directives even if it detects non-updated files 2019-02-25 12:41:11 +09:00
travis-ci travis: stop using the official upstream-systemd-ci repository 2019-02-03 08:51:21 +03:00
units units: re-drop ProtectHostname from systemd-hostnamed.service (#11792) 2019-02-22 08:04:37 +01:00
xorg login: avoid external process call 2018-01-12 18:02:57 +01:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el Better C code formatting of arguments in Emacs 2019-02-28 16:50:53 +01:00
.editorconfig editorconfig: add rule for meson.build files (#6671) 2017-08-28 16:37:23 +02:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore gitignore: add nspawn image lock and mkosi temporary files 2018-09-07 20:00:22 +02:00
.lgtm.yml lgtm: use python3 2018-12-10 03:07:17 +09:00
.mailmap NEWS: update for final v241 2019-02-14 10:58:06 +01:00
.travis.yml travis: add another stage to really run everything under ASan+UBsan 2018-12-24 08:52:33 +01:00
.vimrc coding style: reduce text width to 109 characters 2018-12-08 10:14:28 +01:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure build-sys: add basic support for ./configure && make && make install 2017-07-18 10:05:06 -04: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 build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
meson_options.txt Merge pull request #11827 from keszybz/pkgconfig-variables 2019-02-26 18:58:03 +01:00
meson.build Merge pull request #11827 from keszybz/pkgconfig-variables 2019-02-26 18:58:03 +01:00
mkosi.build mkosi: let's update the boot loader also in /efi 2019-03-01 12:41:32 +01:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
NEWS NEWS: add entry about 'udevadm trigger --wait-daemon' 2019-02-15 10:18:14 +09:00
README README: mention that we need tzdata >= 2014f 2019-02-28 15:38:47 +01:00
README.md Revert "README: remove Coverity Scan badge" 2019-02-14 12:13:55 +01:00
TODO update TODO 2019-03-01 12:41:32 +01:00
zanata.xml po: add basic fedora.zanata.org configuration 2018-02-19 13:56:57 +01:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Semaphore CI Build Status
Coverity Scan Status
CII Best Practices
Travis CI Build Status
Language Grade: C/C++
CentOS CI Build Status

Details

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 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 or join our IRC channel.

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