mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
![Chris Down](/assets/img/avatar_default.png)
In cgroup v2 we have protection tunables -- currently MemoryLow and MemoryMin (there will be more in future for other resources, too). The design of these protection tunables requires not only intermediate cgroups to propagate protections, but also the units at the leaf of that resource's operation to accept it (by setting MemoryLow or MemoryMin). This makes sense from an low-level API design perspective, but it's a good idea to also have a higher-level abstraction that can, by default, propagate these resources to children recursively. In this patch, this happens by having descendants set memory.low to N if their ancestor has DefaultMemoryLow=N -- assuming they don't set a separate MemoryLow value. Any affected unit can opt out of this propagation by manually setting `MemoryLow` to some value in its unit configuration. A unit can also stop further propagation by setting `DefaultMemoryLow=` with no argument. This removes further propagation in the subtree, but has no effect on the unit itself (for that, use `MemoryLow=0`). Our use case in production is simplifying the configuration of machines which heavily rely on memory protection tunables, but currently require tweaking a huge number of unit files to make that a reality. This directive makes that significantly less fragile, and decreases the risk of misconfiguration. After this patch is merged, I will implement DefaultMemoryMin= using the same principles.
9 lines
143 B
Desktop File
9 lines
143 B
Desktop File
[Unit]
|
|
Description=DML passthrough set DML service
|
|
|
|
[Service]
|
|
Slice=dml-passthrough.slice
|
|
Type=oneshot
|
|
ExecStart=/bin/true
|
|
DefaultMemoryLow=15
|