[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-aio
Subject:    Some questions.
From:       Stef Bon <stefbon () gmail ! com>
Date:       2011-01-31 9:34:42
Message-ID: AANLkTim9_bUe1WJ+C8=GgG8pKNT_sA+WQuN0qwB+D-oq () mail ! gmail ! com
[Download RAW message or body]

Hello,

as I've already mentioned here, I'm working on a fuse fs, and want to
make it work with aio.

I've some questions:

a. The aiocp example is a very good example. It's much better than the
aiocp in the man file of io, which totallly does not mention the
alignment.
My advice is to replace that. I've been trying to make aio work for
weeks now, and it's very frustating to not find the right
documentation. Just some days ago I first got the idea how important
the alignment is, when doing aio. The manpage should mention that.

About alignment, Jeff Moyer told me that when reading or writing from
a sata block device, the value alignment is the (logical) blocksize,
which you can detect with BLKSSZGET.
Isn't it the same value when doing a stavfs? My fs can do this once
for every underlying fs/blockdevice and can get this value once and
can store this value for later use, in stead of doing this every time
when doing an aio.

b. When looking at the aiocp example, at the start an array of iocb is
initialised :

io_prep_pread(iocb_free[i], -1, buf, iosize, 0)

now this is very new (and undocumented). What does this?

c. Again the aiocb program from above mentiones that the start and the
end leftovers are written using other flags, not O_DIRECT but O_SYNC.
The size of the buffer is also not aligned, per definition, cause
we're dealing here with non block aligned data.
But the io operations for the start and the end leftovers still work
here. Is it still aio then?


You can say: when doing direct io -> buffer has to be aligned



d.what about aio and network shares, for example smb shares mounted with cifs?

I haven't been testing it.

e. the attached program uses now aio read and write in combination
with epoll, signalfd and eventfd.
It's using aio read and writes, but what's i important is the aio
write. This does determine the start leftover, the aligned middle and
the end leftover when doing a write.

This works, this doesn't have to be done when reading. The offset
(when doing aio read) can just start anywhere, and the buffer to be
read can end anywhere, but it can be done in one read (at least when
it fits in one buffer). I can understand that a litlle bit why, but
can you confirm this?

f. the way writes work in the example program I've written a write
will result in three aio operations (again one for the start leftover,
one for the aligned middle and one the end). It's also possible to do
the middle using aio, and when that has completed, doing the start and
the end using normal io. Has anyone some experiences/examples with
that, or is this a not so good idea?

Stef

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic