linux页面缓存刷新顺序 [英] the linux page cache flush order
问题描述
在将数据写入磁盘之前,存在页面缓存.
There is page cache before we write data to disk.
所以,如果我有两次手术.
So if I have two operations.
write(fileA)
write(fileB)
然后,如果系统突然关闭. 我们不会主动拨打sync()通话.
Then if the system is suddenly shutdown. We don't initiative call the sync() call.
我想知道是否有可能我们写入fileB的数据已刷新到磁盘,而我们写入fileA的数据还没有刷新至磁盘?
I want to know if it is possible that the data we wrote to fileB has flush to the disk, while the data we wrote to fileA haven't been flush to the disk?
推荐答案
我相信fileB可以在fileA之前写入磁盘,因为写入将被捆绑到块I/O请求中,并且可以在以下位置重新排序I/O调度程序在块设备层上尝试最小化磁盘搜索.
I believe that it is possible for fileB to be written to disk before fileA, as the writes will be bundled into block I/O requests and can be reordered at the block device layer by the I/O scheduler in an attempt to minimise disk seeking.
有关I/O调度程序(电梯)的更多信息,请参见内核文档: http://lxr.free-electrons.com/source/Documentation /block/biodoc.txt#L885
See the kernel documentation for more info about the I/O scheduler (elevator): http://lxr.free-electrons.com/source/Documentation/block/biodoc.txt#L885
这篇关于linux页面缓存刷新顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!