这段关于libaio机制的英文,有几处不是很明白
出自这个帖子 http://www.gossamer-threads.com/lists/linux/kernel/1570847?do=post_view_threaded#1570847
最近要解决io_submit阻塞过长的问题,发现相关资料很少,搜到了这个帖子,感觉有些用,但又不太理解回帖中提到的一些方法。回帖内容如下:
Oh, it happens all the time if you are using AIO. If the file system
needs to read or write any metadata block, AIO can become distinctly
non-"A". The workaround that I've chosen is to create a way to cache
the information needed for the bmap() operation, triggered via an
ioctl() issued at open time, so that this is not an issue, but that
only works if the file is pre-allocated, and there is no need to do
any block allocations.
It's all very well and good to say, "the file system should handle
it", but that just pushes the problem onto the file system. And since
you need to potentially issue block I/O requests, which you can't do
from an interrupt context (i.e., a block I/O completion handler), you
really do need to create a workqueue in order to make things work.
If you do it in the fs/direct_io.c layer, at least that way you can
solve the problem once for all file systems....
我的疑问是:
这段英文中说,通过ioctl把bmap函数所需要的信息缓存下来,根据这个意思,ioctl函数要如何调用呢?
另外一处说道if the file is pre-allocated. 这里的文件预分配指得是什么操作呢?
先谢谢了