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
1b3f9dd759
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. |
||
---|---|---|
.github/ISSUE_TEMPLATE | ||
.lgtm/cpp-queries | ||
.mkosi | ||
catalog | ||
coccinelle | ||
docs | ||
factory/etc | ||
hwdb | ||
man | ||
modprobe.d | ||
network | ||
po | ||
presets | ||
rules | ||
semaphoreci | ||
shell-completion | ||
src | ||
sysctl.d | ||
sysusers.d | ||
test | ||
tmpfiles.d | ||
tools | ||
travis-ci | ||
units | ||
xorg | ||
.ctags | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.mailmap | ||
.travis.yml | ||
.vimrc | ||
.ycm_extra_conf.py | ||
configure | ||
LICENSE.GPL2 | ||
LICENSE.LGPL2.1 | ||
Makefile | ||
meson_options.txt | ||
meson.build | ||
mkosi.build | ||
mkosi.default | ||
NEWS | ||
README | ||
README.md | ||
TODO | ||
zanata.xml |
systemd - System and Service Manager
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.