closing kqueue descriptor doesn't release associated kernel resources?

Adrian Chadd adrian at freebsd.org
Mon Oct 28 22:07:47 UTC 2013


Hi!

Yes. The POSIX AIO API puts the responsibility on the programmer to
correctly terminate requests:

* aborting them with aio_cancel() (and it succeeding), or
* waiting for them to complete.

So yes, you're going to have to track them and correctly
abort/complete the requests.

Thanks,


-adrian


On 28 October 2013 14:21, Alexey Egorov <electreg at list.ru> wrote:
>
> Hello all,
> I'm porting application from Linux which uses libaio for async disk IO.
> On FreeBSD we are using kqueue + posix AIO, but I discovered that closing kqueue descriptor doesn't release associated aio requests - sysctl value vfs.aio.num_queue_count keeps growing each time I'm close kqueue fd without waiting for aio requests to complete, and then at some point when limit is reached program hangs.
> Problem getting harder considering that I'm doing IO on raw disk device and can't cancel requests with aio_cancel(2).
> Is it a bug? How can I release this requests without terminating process or waiting for all requests to complete?
> Thanks.
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list