Native Linux AIO in Samba4

Jeremy Allison jra at
Fri Jan 12 17:17:47 GMT 2007

On Fri, Jan 12, 2007 at 05:11:54PM +1100, Andrew Tridgell wrote:
> I've been working a bit on supporting the native Linux AIO API in
> Samba4. The code is now committed, and is working well.

Cool stuff !!!!

> The native Linux API is somewhat different to the posix AIO API. The
> native API is based on libaio.h, and uses io_submit() and
> io_getevents(). The posix API uses calls like aio_read().

Yeah, that's one of the reasons I was ignoring it. The
POSIX api is bad (as usual :-) but is at least a standard.
I'm worried about too many Linux-specific hacks.

Once Solaris goes GPLv3 the whole world will probably
want to move from GNU/Linux to GNU/Solaris so we need
to make sure we're portable (*).

> The main advantages of the native Linux API are that:
>  - on Linux it doesn't spawn off threads to do the work. This makes it
>    much more efficient

That's a problem in the Linux kernel - I'm hoping they'll
adapt glibc to hook the underlying interface into the POSIX api.

> Regarding the epoll/aio kernel code that this relies on, there is some
> discussion of using a new events system in the kernel called kevents
> instead. The kevents API is certainly much cleaner (the aio/epoll
> integration is a pretty nasty hack in comparison!), but I don't know
> which will end up being the standard. Maybe we'll end up with both,
> in which case we'll support both in Samba4.

That's another reason I was waiting - I'm hoping one will win out
in the end and become "standard" on Linux.


(*) Yes, this is a joke :-). But maybe not so funny in the long run :-).

More information about the samba-technical mailing list