freebsd-dev/tests/sys
John Baldwin f3215338ef Refactor the AIO subsystem to permit file-type-specific handling and
improve cancellation robustness.

Introduce a new file operation, fo_aio_queue, which is responsible for
queueing and completing an asynchronous I/O request for a given file.
The AIO subystem now exports library of routines to manipulate AIO
requests as well as the ability to run a handler function in the
"default" pool of AIO daemons to service a request.

A default implementation for file types which do not include an
fo_aio_queue method queues requests to the "default" pool invoking the
fo_read or fo_write methods as before.

The AIO subsystem permits file types to install a private "cancel"
routine when a request is queued to permit safe dequeueing and cleanup
of cancelled requests.

Sockets now use their own pool of AIO daemons and service per-socket
requests in FIFO order.  Socket requests will not block indefinitely
permitting timely cancellation of all requests.

Due to the now-tight coupling of the AIO subsystem with file types,
the AIO subsystem is now a standard part of all kernels.  The VFS_AIO
kernel option and aio.ko module are gone.

Many file types may block indefinitely in their fo_read or fo_write
callbacks resulting in a hung AIO daemon.  This can result in hung
user processes (when processes attempt to cancel all outstanding
requests during exit) or a hung system.  To protect against this, AIO
requests are only permitted for known "safe" files by default.  AIO
requests for all file types can be enabled by setting the new
vfs.aio.enable_usafe sysctl to a non-zero value.  The AIO tests have
been updated to skip operations on unsafe file types if the sysctl is
zero.

Currently, AIO requests on sockets and raw disks are considered safe
and are enabled by default.  aio_mlock() is also enabled by default.

Reviewed by:	cem, jilles
Discussed with:	kib (earlier version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D5289
2016-03-01 18:12:14 +00:00
..
acl Use basenames for getfacl, setfacl, and zpool to work around the 2016-02-06 04:13:20 +00:00
aio Refactor the AIO subsystem to permit file-type-specific handling and 2016-03-01 18:12:14 +00:00
fifo
file Dump out the output from flock_helper on failure so failures with the 2015-12-22 02:10:31 +00:00
geom Similar to r295116, add an additional 1 second sleep after calling ggatel 2016-02-10 17:57:24 +00:00
kern Rename recvfd and sendfd variables in recvfd/sendfd functions to avoid 2015-12-30 18:13:43 +00:00
kqueue Ensure that we test the event condition when a disabled kevent is enabled. 2016-02-19 01:49:33 +00:00
mac Delete the comment about running test_libugidfw_strings before testing 2015-12-23 10:02:51 +00:00
mqueue Fix LDADD/DPADD that should be LIBADD. 2015-12-04 03:17:47 +00:00
netinet
opencrypto
pjdfstest Test directories can build in parallel fine. 2016-02-16 02:13:59 +00:00
posixshm Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD 2015-10-17 04:32:21 +00:00
vfs Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs 2015-10-14 08:16:15 +00:00
vm Add more mmap tests related to character devices. 2015-09-04 01:02:21 +00:00
Makefile Test directories can build in parallel fine. 2016-02-16 02:13:59 +00:00