mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-18 02:20:59 +03:00
8fd65351a7
As soon as wait4() returns, fork() can immediately return with the same PID, and race to lock _launched_processes_lock, then try to add the new (duplicate) PID to _launched_processes, which asserts By locking before wait4(), we ensure, that, given that same unfortunate scheduling, _launched_processes_lock cannot be locked by the spawner before we pop the process in the reaper, and only afterward will it be added This moves where the reaper idles when there are children from the wait4() to the pause(), locking for the duration of that single syscall in both the no-children and running-children cases; the impact of this is one to two syscalls (depending on _launched_processes_lock state) per loop Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Don Brady <don.brady@delphix.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11924 Closes #11928 |
||
---|---|---|
.. | ||
agents | ||
zed.d | ||
.gitignore | ||
Makefile.am | ||
zed_conf.c | ||
zed_conf.h | ||
zed_disk_event.c | ||
zed_disk_event.h | ||
zed_event.c | ||
zed_event.h | ||
zed_exec.c | ||
zed_exec.h | ||
zed_file.c | ||
zed_file.h | ||
zed_log.c | ||
zed_log.h | ||
zed_strings.c | ||
zed_strings.h | ||
zed.c | ||
zed.h |