1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
Commit Graph

37186 Commits

Author SHA1 Message Date
Lennart Poettering
a365325e04
Merge pull request #10567 from cdown/disable_controller
cgroup: Add DisableControllers= directive to disable controller in subtree
2018-12-03 18:58:29 +01:00
Lennart Poettering
76b31bbb24
Merge pull request #10920 from yuwata/hashmap-destructor
hashmap: make hashmap_free() call destructors of key or value
2018-12-03 17:59:44 +01:00
Lennart Poettering
a20f73221a
Merge pull request #10976 from yuwata/typesafe-netlink-call
netlink: introduce typesafe netlink functions
2018-12-03 17:55:00 +01:00
Chris Down
c72703e26d cgroup: Add DisableControllers= directive to disable controller in subtree
Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.

This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.

Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.

This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.
2018-12-03 15:40:31 +00:00
Chris Down
4f6f62e468 cgroup: Traverse leaves to realised cgroup to release controllers
This adds a depth-first version of unit_realize_cgroup_now which can
only do depth-first disabling of controllers, in preparation for the
DisableController= directive.
2018-12-03 14:37:39 +00:00
Chris Down
a57669d290 cgroup: Rework unit_realize_cgroup_now to explicitly be breadth-first
systemd currently doesn't really expend much effort in disabling
controllers. unit_realize_cgroup_now *may* be able to disable a
controller in the basic case when using cgroup v2, but generally won't
manage as downstream dependents may still use it.

This code doesn't add any logic to fix that, but it starts the process
of moving to have a breadth-first version of unit_realize_cgroup_now for
enabling, and a depth-first version of unit_realize_cgroup_now for
disabling.
2018-12-03 14:37:39 +00:00
Chris Down
0d2d6fbf15 cgroup: Move attribute application into unit_create_cgroup
We always end up doing these together, so just colocate them and require
manager state for unit_create_cgroup.
2018-12-03 14:37:38 +00:00
Yu Watanabe
7934dede41 network: drop unnecessary buffers 2018-12-03 12:15:26 +01:00
Lennart Poettering
ad2bf5df89
Merge pull request #10992 from yuwata/follow-up-10948
network: make fib rule accept arbitrary ip protocol
2018-12-03 11:09:04 +01:00
Yu Watanabe
9714c020fc missing: split network related entries
Also adds comments which kernel version added the entries.

Closes #10553.
2018-12-03 10:31:05 +01:00
Harald Hoyer
4a3b569445 sd-boot: remove Stall() call (#11029)
This is left-over from debugging.
2018-12-03 10:27:26 +01:00
Susant Sahani
7b3b982217 vxlan: minor coding style fixes. 2018-12-03 02:05:12 +09:00
Yu Watanabe
c818721579
Merge pull request #11011 from poettering/tmpfile-util
split up fileio.c a bit
2018-12-03 02:04:31 +09:00
Lennart Poettering
29e719ced0 resolved: sort headers again 2018-12-02 13:22:29 +01:00
Lennart Poettering
686d13b9f2 util-lib: split out env file parsing code into env-file.c
It's quite complex, let's split this out.

No code changes, just some file rearranging.
2018-12-02 13:22:29 +01:00
Lennart Poettering
0a2152f005 util-lib: move open_serialization_fd() to serialize.c
It definitely fits better there.

No code changes, just some rearranging.
2018-12-02 13:22:29 +01:00
Lennart Poettering
a12a00c857 resolved: remove duplicate #include 2018-12-02 13:22:29 +01:00
Lennart Poettering
2d9c643b1d test: remove duplicate #include 2018-12-02 13:22:29 +01:00
Lennart Poettering
e4de72876e util-lib: split out all temporary file related calls into tmpfiles-util.c
This splits out a bunch of functions from fileio.c that have to do with
temporary files. Simply to make the header files a bit shorter, and to
group things more nicely.

No code changes, just some rearranging of source files.
2018-12-02 13:22:29 +01:00
Lennart Poettering
ee228be10c util-lib: don't include fileio.h from fileio-label.h
There's no reason for doing that, hence simply don't.
2018-12-02 13:22:29 +01:00
Lennart Poettering
928b3da0f1 test: remove unnecessary include 2018-12-02 13:22:29 +01:00
Lennart Poettering
f4f84a8a62 test: (void)ify unlink() call 2018-12-02 13:22:29 +01:00
Lennart Poettering
603772810c fileio: remove unnecessary initialization 2018-12-02 13:22:28 +01:00
Lennart Poettering
8bdc9a90db fileio: include ctype.h with <> rather than ""
It's a system header after all.
2018-12-02 13:22:28 +01:00
Yu Watanabe
71da167373 sysusers: define main through macro
This also fixes possible memleak when uid/gid or user/group name
in database are conflicted.
2018-12-02 12:18:54 +01:00
Yu Watanabe
f030d36cd0 sysusers: use fgetgrent_sane() 2018-12-02 12:18:54 +01:00
Yu Watanabe
8276855e48 lldp: rename lldp_neighbor_id_hash_ops and set value destructor 2018-12-02 12:18:54 +01:00
Yu Watanabe
e924c60f69 udev: use hashmap_clear_free_key() and hashmap_free_free_key() 2018-12-02 12:18:54 +01:00
Yu Watanabe
67818055b7 portable: introduce portable_metadata_hash_ops and use it 2018-12-02 12:18:54 +01:00
Yu Watanabe
bb1a05d6f3 machine: introduce machine_hash_ops and use it 2018-12-02 12:18:54 +01:00
Yu Watanabe
b07ec5a173 machine-image: introduce image_hash_ops and use it 2018-12-02 12:18:54 +01:00
Yu Watanabe
87938c3bea tmpfiles: define main through macro 2018-12-02 12:18:54 +01:00
Yu Watanabe
71a0be76cd tmpfiles: make load_unix_sockets() return negative errno on failure 2018-12-02 12:18:54 +01:00
Yu Watanabe
a4a90e65c7 cryptsetup-generator: define main through macro 2018-12-02 12:18:54 +01:00
Yu Watanabe
f1bcdd0590 sd-bus: introduce track_item_hash_ops and use it 2018-12-02 12:18:49 +01:00
Yu Watanabe
6121fc3059 dhcp: introduce dhcp_lease_hash_ops and use it 2018-12-02 12:17:28 +01:00
Yu Watanabe
5f5b612203 cgtop: use SWAP_TWO() macro 2018-12-02 12:06:07 +01:00
Yu Watanabe
fb8d181e59 cgtop: introduce group_hash_ops and use it 2018-12-02 12:06:02 +01:00
Yu Watanabe
98233ee5e0 test: add tests for destructors of hashmap or set 2018-12-02 12:05:16 +01:00
Yu Watanabe
59a5cda7b9 hash-func: add destructors for key and value
If they are set, then they are called in hashmap_clear() or
hashmap_free().
2018-12-02 11:59:07 +01:00
Yu Watanabe
7a08d314f2 tree-wide: make hash_ops typesafe 2018-12-02 07:53:27 +01:00
Yu Watanabe
25073e5012 hash-funcs: make basic hash_ops typesafe 2018-12-02 07:48:29 +01:00
Yu Watanabe
d1005d1c00 hash-funcs: introduce macro to create typesafe hash_ops 2018-12-02 07:48:12 +01:00
Yu Watanabe
e30f9c972b util: define free_func_t 2018-12-02 06:34:25 +01:00
Yu Watanabe
ee05335f43 hashmap: fix minor coding style issue 2018-12-02 06:34:25 +01:00
Yu Watanabe
302a796f5a network: use typesafe netlink_call_async() macro where applicable 2018-12-02 06:29:32 +01:00
Yu Watanabe
10ff4eb621 network: rename ndisc_route_handler() to ndisc_netlink_message_handler()
As it is also called when configuring addresses.
2018-12-02 06:28:44 +01:00
Yu Watanabe
bd1175bc46 network: add assertions
As they do not have default callback functions.
2018-12-02 06:23:45 +01:00
Yu Watanabe
4645ad47ac network: use route_remove_handler() as the default callback of route_remove() 2018-12-02 06:23:45 +01:00
Yu Watanabe
63ae056909 network: use address_remove_handler() as the default callback of address_remove() 2018-12-02 06:23:45 +01:00