HomeFreeBSD

Reduce and handle EAGAIN errors on AIO label reads

Description

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

Details

Provenance
mavAuthored on Sep 21 2024, 5:36 PM
GitHub <noreply@github.com>Committed on Sep 21 2024, 5:36 PM
Parents
rG2aafc2ea1f88: Add compatibility file for GRUB versions up to v2.06
Branches
Unknown
Tags
Unknown