337239 |
03-Aug-2018 |
asomers |
MFC r332631:
lio_listio: return EAGAIN instead of EIO when out of resources
This behavior is already documented by the man page, and suggested by POSIX.
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D15099 |
330222 |
01-Mar-2018 |
eadler |
MFC r319590: |
326677 |
08-Dec-2017 |
asomers |
MFC r325817, r325827
r325817: AIO tests: increase limits
tests/sys/aio/aio_kqueue_test.c Instead of using a hard-coded queue depth, use vfs.aio.max_aio_queue_per_proc
tests/sys/aio/lio_kqueue_test.c The old, small limit on lio_listio's operation count was lifted by change 324941. Raise the operation count as high as possible without exceeding the process's operation limit.
Sponsored by: Spectra Logic Corp
r325827: Fix build on arm after r325817
Reported by: rpokala X-MFC-With: 325817 Sponsored by: Spectra Logic Corp |
322892 |
25-Aug-2017 |
asomers |
MFC r321332:
Implement SIGEV_THREAD notifications for lio_listio(2)
Our man pages have always indicated that this was supported, but in fact the feature was never implemented for lio_listio(2).
Reviewed by: jhb, kib (earlier version) Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11680 |
322891 |
25-Aug-2017 |
asomers |
MFC r321082:
Add regression tests for bugs 220459 and 220398
Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0 Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD
PR: 220459 PR: 220398 Reviewed by: cem, jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11470 |
322890 |
25-Aug-2017 |
asomers |
MFC r320974-r320975, r321001, r321206
r320974: Use ATF cleanup routines in aio_test.c
Remove aio_test's legacy timeout handling and cleanup routines. Instead, use ATF's builtin capabilities. ATF automatically cleans up newly created files, too, so we don't have to explicitly unlink them. The only tests than need a cleanup routine are the md(4) tests, which must destroy their md device.
Reviewed by: jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468
r320975: Add tests for aio(4) completion notification via signals and threads
Reviewed by: jhb Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11468
r321001: Fix the build with GCC after r320975
Reported by: pfg X-MFC-With: 320975 Sponsored by: Spectra Logic Corp
r321206: Remove dead code that was killed by r320975
Reported by: Coverity CID: 1377977 X-MFC-With: 320975 Sponsored by: Spectra Logic Corp |
321095 |
17-Jul-2017 |
ngie |
MFC r318180:
Mark all md tests as requiring unsafe AIO in order to function
These tests have been flapping (failing<->passing) on Jenkins for months. It passes reliably for me if unsafe AIO is permitted, but it doesn't pass on Jenkins reliably if unsafe AIO is disabled (the current default).
Mark the tests as requiring unsafe AIO to mitigate the intermittent failures when unsafe AIO isn't permitted. If the kernel code is changed to reliably function with md(4) devices using unsafe AIO, this commit can be reverted.
PR: 217261 |
319497 |
02-Jun-2017 |
asomers |
MFC r312919 (by rwatson)
Fix build of aio_test on MIPS, where the compiler warns about the local variable 'err' shadowing the global function err(3). Which it does.
Sponsored by: DARPA, AFRL Approved by: re |
319218 |
30-May-2017 |
asomers |
MFC r318593:
Fix build of AIO tests with -DDEBUG
Also, redefine some constants for clarity. No functional change. |
319173 |
30-May-2017 |
ngie |
MFC r312913,r318100,r318107:
r312913 (by asomers):
Improve the aio tests
* Add tests for aio_suspend(2). * Add tests for polled completion notification. * Test the full matrix of file descriptor types and completion notification mechanisms. * Don't bother with mkstemp, because ATF runs every test in its own temp dir. * Fix some typos. * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.
r318100:
style(9): move function definition curly braces to column 0
r318107:
Remove unused constant (PATH_TEMPLATE)
It was made unnecessary in r312913.
MFC with: r312913 |
319172 |
30-May-2017 |
ngie |
MFC r318094,r318098,r318099:
r318094:
style(9): clean up trailing whitespace
r318098:
Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO
This is being done to reduce duplication between the two macros.
r318099:
Print out when unsafe AIO is enabled to debugging purposes |
303787 |
05-Aug-2016 |
jhb |
MFC 303406,303501: Fix panic when using aio_fsync().
303406: Adjust tests in fsync job scheduling loop to reduce indentation.
303501: Fix locking issues with aio_fsync().
- Use correct lock in aio_cancel_sync when dequeueing job. - Add _locked variants of aio_set/clear_cancel_function and use those to avoid lock recursion when adding and removing fsync jobs to the per-process sync queue. - While here, add a basic test for aio_fsync().
PR: 211390 Approved by: re (kib) |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
302074 |
21-Jun-2016 |
jhb |
Account for AIO socket operations in thread/process resource usage.
File and disk-backed I/O requests store counts of read/written disk blocks in each AIO job so that they can be charged to the thread that completes an AIO request via aio_return() or aio_waitcomplete(). This change extends AIO jobs to store counts of received/sent messages and updates socket backends to set these counts accordingly. Note that the socket backends are careful to only charge a single messages for each AIO request even though a single request on a blocking socket might invoke sosend or soreceive multiple times. This is to mimic the resource accounting of synchronous read/write.
Adjust the UNIX socketpair AIO test to verify that the message resource usage counts update accordingly for aio_read and aio_write.
Approved by: re (hrs) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6911
|
300626 |
24-May-2016 |
jhb |
Return the correct status when a partially completed request is cancelled.
After the previous changes to fix requests on blocking sockets to complete across multiple operations, an edge case exists where a request can be cancelled after it has partially completed. POSIX doesn't appear to dictate exactly how to handle this case, but in general I feel that aio_cancel() should arrange to cancel any request it can, but that any partially completed requests should return a partial completion rather than ECANCELED. To that end, fix the socket AIO cancellation routine to return a short read/write if a partially completed request is cancelled rather than ECANCELED.
Sponsored by: Chelsio Communications
|
300556 |
24-May-2016 |
jhb |
Don't prematurely return short completions on blocking sockets.
Always requeue an AIO job at the head of the socket buffer's queue if sosend() or soreceive() returns EWOULDBLOCK on a blocking socket. Previously, requests were only requeued if they returned EWOULDBLOCK and completed no data. Now after a partial completion on a blocking socket the request is queued and the remaining request is retried when the socket is ready. This allows writes larger than the currently available space on a blocking socket to fully complete. Reads on a blocking socket that satifsy the low watermark can still return a short read (same as read()).
In order to track previously completed data, the internal 'status' field of the AIO job is used to store the amount of previously computed data.
Non-blocking sockets continue to return short completions for both reads and writes.
Add a test for a "large" AIO write on a blocking socket that writes twice the socket buffer size to a UNIX domain socket.
Sponsored by: Chelsio Communications
|
299094 |
04-May-2016 |
ngie |
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info.
MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
|
298107 |
16-Apr-2016 |
gjb |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
|
298090 |
16-Apr-2016 |
jhb |
Add a test for cancelling an active AIO request on a socket.
The older AIO code awakened all pending AIO requests on a socket when any data arrived. This could result in AIO daemons blocking on an empty socket buffer. These requests could not be cancelled which led to a deadlock during process exit. This test reproduces this case. The newer AIO code is able to cancel the pending AIO request correctly.
Reviewed by: ngie (-ish) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D4363
|
297474 |
31-Mar-2016 |
jhb |
Correct error messages in recently added test.
The large read test uses an empty file created via mkstemp() rather than /dev/null as character devices are subject to two different clamping sysctls. However, I forgot to update some of the error messages after changing to mkstemp() that were still referring to /dev/null.
|
297167 |
21-Mar-2016 |
jhb |
Fully handle size_t lengths in AIO requests.
First, update the return types of aio_return() and aio_waitcomplete() to ssize_t.
POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason.
aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int.
Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value.
Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX.
aio_read/write should now honor the same length limits as normal read/write.
Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned.
Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file.
|
296587 |
09-Mar-2016 |
bdrewery |
DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by: EMC / Isilon Storage Division
|
296277 |
01-Mar-2016 |
jhb |
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
|
292819 |
28-Dec-2015 |
ngie |
- Fix an improperly sized buffer for `pathname` [1] - Fix a -Wunused-but-set-variable warning [2]
MFC after: 1 week Reported by: cppcheck [1], gcc 4.9 [2] Sponsored by: EMC / Isilon Storage Division
|
292818 |
28-Dec-2015 |
ngie |
Fix style(9) a bit and ensure that error from initializing kqueue(2) is sane
- Push the kqueue(2) initialization down so the errno will correspond with the failure instead of potentially being stomped on by functions called by `PLAIN_REQUIRE_KERNEL_MODULE` - Delete trailing whitespace - Add spaces between braces for conditional and control blocks (for/if) - Use err/errx instead of perror+printf+exit/printf+exit. - Remove braces for single-line conditionals
Tested with and without -DDEBUG
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
292816 |
28-Dec-2015 |
ngie |
Place cancel and error under #ifdef DEBUG to mute -Wunused-but-set-variable warnings reported by gcc 4.9
Remove some trailing whitespace as well
Tested with and without -DDEBUG
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
291738 |
04-Dec-2015 |
bdrewery |
Fix LDADD/DPADD that should be LIBADD.
Sponsored by: EMC / Isilon Storage Division
|
282138 |
28-Apr-2015 |
ngie |
Adjust CFLAGS to find freebsd_test_suite/macros.h
MFC after: 6 days
|
282136 |
28-Apr-2015 |
ngie |
- Use ATF_REQUIRE_KERNEL_MDOULE to require aio(4) - Don't use /tmp as a basis for temporary files as it's outside of the ATF sandbox - Don't override MAX macro in sys/param.h
MFC after: 6 days
|
282135 |
28-Apr-2015 |
ngie |
Use ATF_REQUIRE_KERNEL_MODULE instead of aio_available function
MFC after: 6 days
|
282074 |
27-Apr-2015 |
ngie |
Integrate tools/regression/aio/aiotest and tools/regression/aio/kqueue into the FreeBSD test suite as tests/sys/aio
MFC after: 1 week
|
281593 |
16-Apr-2015 |
ngie |
Integrate tools/regression/aio/aiotest into the FreeBSD test suite as tests/sys/aio
|