这段关于libaio机制的英文,有几处不是很明白

netxuning 2013-02-02 12:20:57
出自这个帖子 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. 这里的文件预分配指得是什么操作呢?

先谢谢了
...全文
71 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
netxuning 2013-02-02
  • 打赏
  • 举报
回复
关于文件预分配,我的理解是用ftruncate给文件先分配好大小,这理解对吗?

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧