Paul Brook wrote:
Yes, librt is providing posix-aio, and librt coming with GNU libc uses
threads.
But if I remember correctly librt coming with RHEL uses a mix of threads
and linux kernel AIO (you can have a look to the .srpm of libc).
BTW, if everyone thinks it could be a good idea I can port block-raw.c
to use linux kernel AIO (without removing POSIX AIO support, of course)
This seems rather pointless, given a user can just use a linux-AIO librt
instead.
Not at all. linux-aio is the only interface that allows you to do
asynchronous fdsync which simulates a barrier which allows for an
ordered queue.
I have a patch that uses linux-aio for the virtio-blk driver I'll be
posting tomorrow and I'm extremely happy with the results. In recent
kernels, you can use an eventfd interface along with linux-aio so that
polling is unnecessary. Along with O_DIRECT and the preadv/pwritev
interface, you can make a block backend in userspace that performs just
as well as if it were in the kernel.
The posix-aio interface simply doesn't provide a mechanism to do these
things.
Regards,
Anthony Liguori
Paul