Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: andyj on January 11, 2018, 07:22:29 PM
-
Why does this happen?
tc@box:~$ sudo udevadm trigger ; sleep 1; ps faux | cut -c 65-
COMMAND
[kthreadd]
\_ [kworker/0:0]
\_ [kworker/0:0H]
\_ [mm_percpu_wq]
\_ [ksoftirqd/0]
\_ [rcu_sched]
\_ [rcu_bh]
\_ [migration/0]
\_ [cpuhp/0]
\_ [cpuhp/1]
\_ [migration/1]
\_ [ksoftirqd/1]
\_ [kworker/1:0H]
\_ [cpuhp/2]
\_ [migration/2]
\_ [ksoftirqd/2]
\_ [kworker/2:0]
\_ [kworker/2:0H]
\_ [cpuhp/3]
\_ [migration/3]
\_ [ksoftirqd/3]
\_ [kworker/3:0H]
\_ [netns]
\_ [kworker/0:1]
\_ [oom_reaper]
\_ [writeback]
\_ [kcompactd0]
\_ [ksmd]
\_ [khugepaged]
\_ [crypto]
\_ [kintegrityd]
\_ [kblockd]
\_ [ata_sff]
\_ [devfreq_wq]
\_ [watchdogd]
\_ [rpciod]
\_ [xprtiod]
\_ [kswapd0]
\_ [nfsiod]
\_ [kworker/3:1]
\_ [kworker/1:1]
\_ [kworker/2:1]
\_ [acpi_thermal_pm]
\_ [scsi_eh_0]
\_ [scsi_tmf_0]
\_ [vmw_pvscsi_wq_0]
\_ [nvme-wq]
\_ [scsi_eh_1]
\_ [scsi_tmf_1]
\_ [scsi_eh_2]
\_ [scsi_tmf_2]
\_ [scsi_eh_3]
\_ [scsi_tmf_3]
\_ [scsi_eh_4]
\_ [scsi_tmf_4]
\_ [scsi_eh_5]
\_ [scsi_tmf_5]
\_ [scsi_eh_6]
\_ [scsi_tmf_6]
\_ [scsi_eh_7]
\_ [scsi_tmf_7]
\_ [scsi_eh_8]
\_ [scsi_tmf_8]
\_ [scsi_eh_9]
\_ [scsi_tmf_9]
\_ [scsi_eh_10]
\_ [scsi_tmf_10]
\_ [scsi_eh_11]
\_ [scsi_tmf_11]
\_ [scsi_eh_12]
\_ [scsi_tmf_12]
\_ [scsi_eh_13]
\_ [scsi_tmf_13]
\_ [scsi_eh_14]
\_ [scsi_tmf_14]
\_ [scsi_eh_15]
\_ [scsi_tmf_15]
\_ [scsi_eh_16]
\_ [scsi_tmf_16]
\_ [scsi_eh_17]
\_ [scsi_tmf_17]
\_ [scsi_eh_18]
\_ [scsi_tmf_18]
\_ [scsi_eh_19]
\_ [scsi_tmf_19]
\_ [scsi_eh_20]
\_ [scsi_tmf_20]
\_ [scsi_eh_21]
\_ [scsi_tmf_21]
\_ [scsi_eh_22]
\_ [scsi_tmf_22]
\_ [scsi_eh_23]
\_ [scsi_tmf_23]
\_ [scsi_eh_24]
\_ [scsi_tmf_24]
\_ [scsi_eh_25]
\_ [scsi_tmf_25]
\_ [scsi_eh_26]
\_ [scsi_tmf_26]
\_ [scsi_eh_27]
\_ [scsi_tmf_27]
\_ [scsi_eh_28]
\_ [scsi_tmf_28]
\_ [scsi_eh_29]
\_ [scsi_tmf_29]
\_ [scsi_eh_30]
\_ [scsi_tmf_30]
\_ [scsi_eh_31]
\_ [scsi_tmf_31]
\_ [scsi_eh_32]
\_ [scsi_tmf_32]
\_ [vfio-irqfd-clea]
\_ [kstrp]
\_ [kworker/3:3]
\_ [jbd2/sda1-8]
\_ [ext4-rsv-conver]
\_ [kworker/1:2]
\_ [kworker/0:1H]
\_ [kworker/2:1H]
\_ [kworker/3:1H]
\_ [kworker/1:1H]
\_ [ttm_swap]
\_ [irq/16-vmwgfx]
\_ [kworker/u128:0]
\_ [kworker/u128:2]
\_ [kworker/u128:1]
\_ [kworker/u128:3]
/sbin/init
/sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0A05:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0700:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C02:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0A05:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0A05:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [udevd]
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe] <defunct>
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0A05:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ [modprobe]
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
| \_ /sbin/modprobe -bv acpi:PNP0C80:
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
\_ /sbin/udevd --daemon
/sbin/syslogd
/sbin/klogd
vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse
/usr/local/bin/vmtoolsd
-sh
vmhgfs-fuse /mnt/hgfs
/usr/local/lib/xorg/Xorg -nolisten tcp
flwm_topside
/sbin/udhcpc -b -i eth0 -x hostname:box -p /var/run/udhcpc.eth0.pid
/usr/local/bin/vmtoolsd -n vmusr --blockFd 3
wbar
\_ urxvt
\_ sh
\_ ps faux
\_ cut -c 65
dbus-launch --autolaunch 03b81d633b3551dd19f589bb5a57dd34 --binary-syntax --close-stderr
/usr/local/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
/usr/local/lib/at-spi2-core/at-spi-bus-launcher
\_ /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
/usr/local/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
Sometimes there's so many that my VM won't boot, or it crashes when loading certain extensions. I had to bump it to 8 gigs. This is on 64-bit, 8.x and now 9 alpha.
-
IIRC it spawns a child to handle each event that may need further processing, and there's a limit to how many it spawns at once. On 32-bit I remember we lowered the limit to keep the minimum RAM requirement low.
However, the default limit is not that high, and each udevd fork takes only hundreds of kb of RAM. For you to need gigs, something else must be off.
-
Could we add:
/sbin/udevadm control --children-max=12
to /etc/init.d/tc-config after line 107 where udevd is started? I don't have a good reason for picking 12, other than it seemed like a good place to start.
-
The default is 128 and on 32-bit we lowered it to 28. On the command, I'd much rather have it straight in the udev binary, spawning a process every boot will cause slowdown, even if tiny, and this can be "baked in".
edit: Looking at my patch, each udev worker used 180kb of RAM on 32-bit. Even if we conservatively double that for 64-bit, it's not possible for it to need gigs.
-
Why would the process limit for 64-bit be any different, and where does 28 come from?
-
28 was measured to keep the minimum RAM requirement in place, IIRC. On 64-bit, the patch wasn't applied as 64-bit systems generally have the RAM to run 128*180kb = 23mb worth of udev processes.
-
Hi curaga
If each /sbin/udevd --daemon line in the listing andyj posted is a separate process, he's got 369 of them running.
-
Apparently the max number of children is based on RAM so the more memory you have the worse the problem gets. Anyway, there's an easy fix. Add "udev.children-max=24" to the kernel command line. Why 24? Because my VM has 4 CPU's and 1 active process and 5 waiting per CPU seemed like enough. I'm not sure how to find the best answer. But it does seem to me the limiting factor to how many you could reasonably run would be the number of CPU's and not RAM. I'm still not sure why it's doing what it does. And it looks to me like each child spawns a modprobe so between the two that 7.5 megs each and 1 active and 11 waiting per CPU, ignoring all the other processes already running.
tc@box:~$ sudo udevadm trigger; usleep 300000; ps faux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2 0.0 0.0 0 0 ? S 01:00 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/0:0]
root 4 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/0:0H]
root 6 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [mm_percpu_wq]
root 7 0.0 0.0 0 0 ? S 01:00 0:00 \_ [ksoftirqd/0]
root 8 0.0 0.0 0 0 ? I 01:00 0:00 \_ [rcu_sched]
root 9 0.0 0.0 0 0 ? I 01:00 0:00 \_ [rcu_bh]
root 10 0.0 0.0 0 0 ? S 01:00 0:00 \_ [migration/0]
root 11 0.0 0.0 0 0 ? S 01:00 0:00 \_ [cpuhp/0]
root 12 0.0 0.0 0 0 ? S 01:00 0:00 \_ [cpuhp/1]
root 13 0.0 0.0 0 0 ? S 01:00 0:00 \_ [migration/1]
root 14 0.0 0.0 0 0 ? S 01:00 0:00 \_ [ksoftirqd/1]
root 15 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/1:0]
root 16 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/1:0H]
root 17 0.0 0.0 0 0 ? S 01:00 0:00 \_ [cpuhp/2]
root 18 0.0 0.0 0 0 ? S 01:00 0:00 \_ [migration/2]
root 19 0.0 0.0 0 0 ? S 01:00 0:00 \_ [ksoftirqd/2]
root 21 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/2:0H]
root 22 0.0 0.0 0 0 ? S 01:00 0:00 \_ [cpuhp/3]
root 23 0.0 0.0 0 0 ? S 01:00 0:00 \_ [migration/3]
root 24 0.0 0.0 0 0 ? S 01:00 0:00 \_ [ksoftirqd/3]
root 25 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/3:0]
root 26 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/3:0H]
root 27 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [netns]
root 28 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/0:1]
root 29 0.0 0.0 0 0 ? S 01:00 0:00 \_ [oom_reaper]
root 30 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [writeback]
root 31 0.0 0.0 0 0 ? S 01:00 0:00 \_ [kcompactd0]
root 32 0.0 0.0 0 0 ? SN 01:00 0:00 \_ [ksmd]
root 33 0.0 0.0 0 0 ? SN 01:00 0:00 \_ [khugepaged]
root 34 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [crypto]
root 35 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kintegrityd]
root 36 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kblockd]
root 38 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/2:1]
root 39 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/3:1]
root 40 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [ata_sff]
root 41 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [devfreq_wq]
root 42 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [watchdogd]
root 43 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [rpciod]
root 44 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [xprtiod]
root 48 0.0 0.0 0 0 ? S 01:00 0:00 \_ [kswapd0]
root 49 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [nfsiod]
root 83 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [acpi_thermal_pm]
root 84 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_0]
root 85 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_0]
root 86 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [vmw_pvscsi_wq_0]
root 87 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [nvme-wq]
root 90 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_1]
root 91 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_1]
root 92 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_2]
root 93 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_2]
root 94 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_3]
root 95 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_3]
root 96 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_4]
root 97 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_4]
root 98 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_5]
root 99 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_5]
root 100 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_6]
root 101 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_6]
root 102 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_7]
root 103 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_7]
root 104 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_8]
root 105 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_8]
root 106 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_9]
root 107 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_9]
root 108 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_10]
root 109 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_10]
root 110 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_11]
root 111 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_11]
root 112 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_12]
root 113 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_12]
root 114 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_13]
root 115 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_13]
root 116 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_14]
root 117 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_14]
root 118 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_15]
root 119 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_15]
root 120 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_16]
root 121 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_16]
root 122 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_17]
root 123 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_17]
root 124 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_18]
root 125 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_18]
root 126 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_19]
root 127 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_19]
root 128 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_20]
root 129 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_20]
root 130 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_21]
root 131 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_21]
root 132 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_22]
root 133 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_22]
root 134 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_23]
root 135 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_23]
root 136 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_24]
root 137 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_24]
root 138 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_25]
root 139 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_25]
root 140 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_26]
root 141 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_26]
root 142 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_27]
root 143 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_27]
root 144 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_28]
root 145 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_28]
root 146 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_29]
root 147 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_29]
root 148 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_30]
root 149 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_30]
root 153 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_31]
root 155 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_31]
root 157 0.0 0.0 0 0 ? S 01:00 0:00 \_ [scsi_eh_32]
root 159 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [scsi_tmf_32]
root 166 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [vfio-irqfd-clea]
root 183 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/u128:31]
root 187 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kstrp]
root 205 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/2:3]
root 206 0.0 0.0 0 0 ? I 01:00 0:00 \_ [kworker/1:2]
root 1339 0.0 0.0 0 0 ? S 01:00 0:00 \_ [jbd2/sda1-8]
root 1341 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [ext4-rsv-conver]
root 1498 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/3:1H]
root 1513 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/0:1H]
root 1634 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/1:1H]
root 1640 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [kworker/2:1H]
root 3448 0.0 0.0 0 0 ? I< 01:00 0:00 \_ [ttm_swap]
root 3449 0.0 0.0 0 0 ? S 01:00 0:00 \_ [irq/16-vmwgfx]
root 9733 0.0 0.0 0 0 ? I 01:14 0:00 \_ [kworker/u128:0]
root 12929 0.0 0.0 0 0 ? I 01:19 0:00 \_ [kworker/u128:1]
root 1 0.0 0.0 10064 988 ? Ss 01:00 0:00 /sbin/init
root 239 2.3 0.1 13104 6648 ? Rs 01:00 0:35 /sbin/udevd --daemon
root 24890 0.8 0.1 13104 6504 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32808 0.0 0.0 676 4 ? R 01:25 0:00 | \_ [modprobe]
root 24891 0.7 0.1 13104 6504 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 25664 0.7 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32788 0.0 0.0 10064 1140 ? R 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0C02:
root 25666 0.5 0.1 13104 6504 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32789 0.0 0.0 10064 1136 ? S 01:25 0:00 | \_ /sbin/modprobe -bv acpi:VMW0001:VM_GEN_COUNTER:PNP0C02:
root 25667 0.3 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32809 0.0 0.1 13104 5044 ? R 01:25 0:00 | \_ /sbin/udevd --daemon
root 25668 0.5 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32790 0.0 0.0 10064 1020 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:APP0001:SMC-SANTAROSA:
root 25670 0.4 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32807 0.0 0.1 13104 5044 ? R 01:25 0:00 | \_ /sbin/udevd --daemon
root 25671 0.4 0.1 13104 6492 ? R 01:24 0:00 \_ /sbin/udevd --daemon
root 32792 0.0 0.0 0 0 ? Z 01:25 0:00 | \_ [modprobe] <defunct>
root 25672 0.4 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32791 0.0 0.0 10064 968 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0100:
root 25673 0.3 0.1 13104 6488 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 25674 0.4 0.1 13104 6428 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32794 0.0 0.0 10064 972 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0200:
root 25675 0.3 0.1 13104 6424 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32796 0.0 0.0 10064 1136 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0303:
root 25676 0.3 0.1 13104 6428 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32795 0.0 0.0 10064 1136 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0400:
root 25677 0.3 0.1 13104 6424 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32798 0.0 0.0 10064 976 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0400:
root 25678 0.3 0.1 13104 6424 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32797 0.0 0.0 10064 1140 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0501:
root 25679 0.3 0.1 13104 6424 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 25680 0.3 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32784 0.0 0.0 10064 1140 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:LNXCPU:
root 25681 0.3 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 25682 0.3 0.1 13104 6500 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32799 0.0 0.0 10064 1140 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0501:
root 25683 0.3 0.1 13104 6428 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32801 0.0 0.0 0 0 ? R 01:25 0:00 | \_ [modprobe]
root 25684 0.3 0.1 13104 6496 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32802 0.0 0.0 10064 1028 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0501:
root 25686 0.3 0.1 13104 6492 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32805 0.0 0.0 10064 980 ? D 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0501:
root 25687 0.3 0.1 13104 6424 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32804 0.0 0.0 10064 1140 ? R 01:25 0:00 | \_ /sbin/modprobe -bv acpi:PNP0501:
root 25688 0.3 0.1 13104 6400 ? S 01:24 0:00 \_ /sbin/udevd --daemon
root 32803 0.0 0.0 10064 1136 ? D 01:25 0:00 \_ /sbin/modprobe -bv acpi:PNP0501:
root 1217 0.0 0.0 10064 108 ? Ss 01:00 0:00 /sbin/syslogd
root 1219 0.0 0.0 10064 100 ? Ss 01:00 0:00 /sbin/klogd
root 3548 0.0 0.0 208872 524 ? Ssl 01:00 0:00 vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse
root 3556 0.1 0.2 106272 9644 ? S 01:00 0:02 /usr/local/bin/vmtoolsd
tc 6807 0.0 0.0 12176 2504 tty1 Ss+ 01:00 0:00 -sh
tc 6843 0.0 0.0 169352 3100 ? Ssl 01:00 0:00 vmhgfs-fuse /mnt/hgfs
root 8063 1.1 1.5 320336 61572 tty2 Ssl+ 01:00 0:17 /usr/local/lib/xorg/Xorg -nolisten tcp
tc 8068 0.0 0.1 51156 6248 tty1 S 01:00 0:00 flwm_topside
tc 8521 0.2 1.1 349320 45708 tty1 S 01:00 0:03 /usr/local/bin/vmtoolsd -n vmusr --blockFd 3
tc 8589 0.0 0.2 80228 8180 tty1 S 01:00 0:00 wbar
tc 8911 0.0 0.2 73148 8524 tty1 S 01:00 0:00 \_ urxvt
tc 8912 0.0 0.0 12176 2468 pts/0 Ss 01:00 0:00 | \_ sh
tc 12931 0.6 0.0 17268 2844 pts/0 S+ 01:19 0:02 | \_ top
tc 8924 0.0 0.2 73944 9856 tty1 S 01:00 0:01 \_ urxvt
tc 8925 0.0 0.0 12176 2508 pts/1 Ss 01:00 0:00 \_ sh
tc 32810 0.0 0.0 13064 2660 pts/1 R+ 01:25 0:00 \_ ps faux
tc 8856 0.0 0.0 30596 2360 tty1 S 01:00 0:00 dbus-launch --autolaunch e3aea5c4876ce0154a7a70895a5d4eb2 --binary-syntax --close-stderr
tc 8861 0.0 0.0 12928 2012 ? Ss 01:00 0:00 /usr/local/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
tc 8865 0.0 0.1 269112 7276 ? Sl 01:00 0:00 /usr/local/lib/at-spi2-core/at-spi-bus-launcher
tc 8895 0.0 0.0 12928 2188 ? S 01:00 0:00 \_ /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
tc 8903 0.0 0.1 204324 5284 ? Sl 01:00 0:00 /usr/local/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
root 8910 0.0 0.0 10064 104 ? Ss 01:00 0:00 /sbin/udhcpc -b -i eth0 -x hostname:box -p /var/run/udhcpc.eth0.pid
-
RSS is not the amount of memory used, due to copy-on-write and general memory sharing. "pmap -d PID" will show a more accurate number, though even that one is slightly too large when multiple copies are running.
-
Hi curaga
If each /sbin/udevd --daemon line in the listing andyj posted is a separate process, he's got 369 of them running.
Yeah, the exact formula adds some according to RAM.
-
I did some testing using udevadm monitor and trigger and came up with some data. I created a file with some plausible max-children numbers, did eight runs shuffling the numbers each time, and totaled the elapsed time based on the kernel time difference between the first and last events:
(http://www.asjohnson.com/max-children-times.png)
It turns out that 24 max-children was a good guess, so I'm going to stick with that for now. Yes, 48 looks better, but 24 is almost as good and uses half the memory. Keep in mind that this is on a 64-bit VMware VM with 4 CPU's and 4 GB RAM. I didn't script it, but here are the details in case someone wants to take it on:
In one terminal window:
udevadm monitor -k -u > udevadm-child-test
In another terminal window:
for a in $(cat numbers_file); do echo $a; sudo udevadm control --children-max=$a; sudo udevadm trigger; sleep 15; done
Wait 20 minutes, then ctrl-C the monitor. You will need to see what the first line of the output file is, then grep -B1 for that line in the output and append the last line. At this point I pasted the results into LibreOffice Calc and hammered it all out, but a clever person could work out the details to get the results in a script. My monitor test file had 362k lines because each trigger generates almost 3600 events so expect a few. I'm curious how it would go on real hardware.
-
I reran the same test but with 30 trials for each candidate:
(http://www.asjohnson.com/max-children-time2.png)
Some smoothing, but otherwise about the same. The bump for 36 is still evident. I don't know what that's about. The times are averages in seconds for this graph. This also confirms that the settle timeout of 5 seconds should be good enough for any reasonable setting of max-children.