nuttx/fs/aio/Kconfig
Xiang Xiao d5d134bc79 fs/aio: raise the default AIO_LISTIO_MAX so LTP keeps passing
The new CONFIG_FS_AIO_LISTIO_MAX option defaults to 10 and lio_listio()
now rejects nent > {AIO_LISTIO_MAX} with EINVAL.  The LTP release pinned
by apps/testing/ltp (20230516) submits 256 requests in a single batch from
conformance/interfaces/lio_listio/2-1.c, so ltp_interfaces_lio_listio_2_1
now fails on every configuration that enables CONFIG_TESTING_LTP
(sim:citest, rv-virt:citest, sim:posix_test):

  lio_listio/2-1.c Error at lio_listio() 22: Invalid argument

The EINVAL check itself is required by POSIX, so keep it and raise the
default instead; the limit no longer costs memory because the requests are
linked through the aiocb's own lio_link.

While here, keep _POSIX_AIO_LISTIO_MAX at its POSIX-mandated value of 2
and let AIO_LISTIO_MAX carry the configurable implementation limit.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-09-14 17:12:49 -03:00

46 lines
1.6 KiB
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config FS_AIO
bool "Asynchronous I/O support"
default n
depends on SCHED_WORKQUEUE && !DISABLE_ALL_SIGNALS
---help---
Enable support for asynchronous I/O. This selection enables the
interfaces declared in include/aio.h.
config FS_AIO_LISTIO_MAX
int "Maximum number of AIO operations in listio"
default 256
---help---
This option sets the maximum number of asynchronous I/O (AIO) operations
that can be submitted in a single call to lio_listio().
This value defines the upper limit for the 'nent' parameter in
lio_listio(mode, aiocb_list, nent, sevp). Increasing this value allows
more operations to be queued.
Default: 10
if FS_AIO
config FS_NAIOC
int "Pre-allocated AIO containers"
default 8
---help---
The AIO containers hold an AIO control block and appends information
needed by the logic running within the RTOS. These structures are
pre-allocated, the number pre-allocated controlled by this setting.
This setting controls the number of asynchronous I/O operations that
can be queued at one time. When this count is exhausted, the caller
of aio_read(), aio_write(), or aio_fsync() will be forced to wait
for an available container. That wait is minimized because each
container is released prior to starting the next I/O.
The AIO logic includes priority inheritance logic to prevent
priority inversion problems: The priority of the low-priority work
queue will be boosted, if necessary, to level of the waiting thread.
endif