Page MenuHomeFreeBSD

aio_waitcomplete(2) should not sleep when timeout is not NULL, but set to 0.
ClosedPublic

Authored by pjd on Oct 5 2015, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 1:54 PM
Unknown Object (File)
Jan 23 2024, 11:38 PM
Unknown Object (File)
Dec 20 2023, 2:34 AM
Unknown Object (File)
Dec 10 2023, 1:36 PM
Unknown Object (File)
Dec 3 2023, 12:51 PM
Unknown Object (File)
Oct 10 2023, 1:33 PM
Unknown Object (File)
Oct 8 2023, 9:47 AM
Unknown Object (File)
Sep 21 2023, 4:51 PM
Subscribers
None

Details

Reviewers
jhb

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

pjd retitled this revision from to aio_waitcomplete(2) should not sleep when timeout is not NULL, but set to 0..
pjd updated this object.
pjd edited the test plan for this revision. (Show Details)
pjd added a reviewer: jhb.
sys/kern/vfs_aio.c
2511

Maybe make a smaller diff by checking for timo == -1 in here? That is, just

while (...) {
    if (timo == -1) {
        error = EWOULDBLOCK;
        break;
    }
}

I've seen this pattern in other places in the kernel. Often the sleep is done in the else in this case. Also, even though EGAIN == EWOULDBLOCK on FreeBSD, EWOULDBLOCK (or EINPROGRESS) better matches the existing error descriptions in the aio_waitcomplete(2) manpage. It is also what other places in the kernel use when skipping a sleep due to a poll.

Also, this thing should just be converting the timespec directly to an sbintime_t and using mtx_sleep_sbt() or whatever it is called.

In D3814#78778, @jhb wrote:

Also, this thing should just be converting the timespec directly to an sbintime_t and using mtx_sleep_sbt() or whatever it is called.

Though that can be done in a follow up change (sorry, meant to say that originally)

pjd edited edge metadata.

Thanks John, both good suggestions.

jhb edited edge metadata.
This revision is now accepted and ready to land.Oct 22 2015, 12:32 AM