diff options
author | наб <[email protected]> | 2021-04-02 15:10:34 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-07 14:50:38 -0700 |
commit | 64c03a0a27a4d746b3b4e5eca22c7b7ed63b25db (patch) | |
tree | 0a5963a317e916f13494210275be11ee4f7280fc /config/kernel-kuid-helpers.m4 | |
parent | 3bc3eef9c3f1c71bae09ef546bdc990621771c87 (diff) |
zed: implement close_from() in terms of /proc/self/fd, if available
/dev/fd on Darwin
Consider the following strace output:
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
Yes, that is well over a million file descriptors!
This reduces the ZED start-up time from "at least a second" to
"instantaneous", and, under strace, from "don't even try" to "usable"
by simple virtue of doing five syscalls instead of over a million;
in most cases the main loop does nothing
Recent Linuxes (5.8+) have close_range(2) for this, but that's an
overoptimisation (and libcs don't have wrappers for it yet)
This is also run by the ZEDLET pre-exec. Compare:
Finished "all-syslog.sh" eid=13 pid=6717 time=1.027100s exit=0
Finished "history_event-zfs-list-cacher.sh" eid=13 pid=6718 time=1.046923s exit=0
to
Finished "all-syslog.sh" eid=12 pid=4834 time=0.001836s exit=0
Finished "history_event-zfs-list-cacher.sh" eid=12 pid=4835 time=0.001346s exit=0
lol
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11834
Diffstat (limited to 'config/kernel-kuid-helpers.m4')
0 files changed, 0 insertions, 0 deletions