]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/udev/udevd.c
systemd-udevd: limit children-max by available memory (#8668)
authorMartin Wilck <mwilck@suse.com>
Sat, 7 Apr 2018 15:33:48 +0000 (17:33 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 7 Apr 2018 15:33:48 +0000 (17:33 +0200)
commite438c57a640ac5afba366531be5e456b9fe22672
treebf05197083bf8ff2bc692e2f0c9a24f2f044228f
parent598749a8c9c14b0252390201f6d66f1cf7b45841
systemd-udevd: limit children-max by available memory (#8668)

Udev workers consume typically 50-100MiB virtual memory.
On systems with lots of CPUs and relatively low memory, that may
easily cause workers to be OOM-killed.

This patch limits the number of workers to 8 per GiB memory.
But don't let the limit drop below the smallest value we had
without this patch (8 + 1 * 2 = 10); on small systems, udev's
memory footprint is likely lower.
src/udev/udevd.c