mirror_zfs/lib
Alexander Motin 3014dcb762
Reduce and handle EAGAIN errors on AIO label reads
At least FreeBSD has a limit of 256 simultaneous AIO requests per
process. Attempt to issue more results in EAGAIN errors. Since we
issue 4 requests per disk/partition from 2xCPUs threads, it is
quite easy to reach that limit on large systems, that results in
random pool import failures.  It annoyed me for quite a while on
a system with 64 CPUs and 70+ partitioned disks.

This patch from one side limits the number of threads to avoid the
error, while from another should softly fall back to sync reads in
case of error.  It takes into account _SC_AIO_MAX as a system-wide
AIO limit and _SC_AIO_LISTIO_MAX as a closest value to per-process
limit.  The last not exactly right, but it is the best I found.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16551
2024-09-21 10:36:25 -07:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
libicp icp: remove skein module 2024-05-31 15:13:39 -07:00
libnvpair libspl: lift backtrace into a separate file 2024-05-14 09:48:45 -07:00
libshare Fix handling of DNS names with '-' in them for sharenfs 2024-09-17 13:56:26 -07:00
libspl Add SIMD metadata in /proc on Linux 2024-09-20 08:16:44 -07:00
libtpool tpool_dispatch: fail if it cannot start at least 1 worker. 2024-05-14 09:35:48 -07:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil JSON output support for zpool status 2024-08-06 12:47:10 -07:00
libzdb Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
libzfs zcommon: add specialized versions of cityhash4 2024-09-19 15:18:59 -07:00
libzfs_core Add DDT prune command 2024-09-04 14:17:02 -07:00
libzfsbootenv nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libzpool Add SIMD metadata in /proc on Linux 2024-09-20 08:16:44 -07:00
libzstd libzstd: also build with LIBZPOOL_CPPFLAGS 2024-09-09 14:13:27 -07:00
libzutil Reduce and handle EAGAIN errors on AIO label reads 2024-09-21 10:36:25 -07:00
Makefile.am libzdb: Initial breakout of libzdb 2024-02-05 10:00:41 -08:00