From: Yu Watanabe Date: Thu, 1 Nov 2018 07:54:10 +0000 (+0900) Subject: udevd: increase default number of workers X-Git-Tag: v240~402^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10658%2Fhead;p=thirdparty%2Fsystemd.git udevd: increase default number of workers The uevent handling in udevd is not cpu hungry. So, let's increase the default number of workers per cpu. This decrease the number of queued uevents. Without this commit (children_max is 16 on my laptop) ``` $ journalctl -b -u systemd-udevd.service | grep reached | wc -l 1544 ``` With this commit (children_max is 30 on my laptop) ``` $ journalctl -b -u systemd-udevd.service | grep reached | wc -l 7 ``` --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index cff0afdd3d6..53a77ee0375 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1786,7 +1786,7 @@ int main(int argc, char *argv[]) { arg_children_max = 8; if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == 0) - arg_children_max += CPU_COUNT(&cpu_set) * 2; + arg_children_max += CPU_COUNT(&cpu_set) * 8; mem_limit = physical_memory() / (128LU*1024*1024); arg_children_max = MAX(10U, MIN(arg_children_max, mem_limit));