gpt4 book ai didi

linux-kernel - linux页面缓存刷新顺序

转载 作者:行者123 更新时间:2023-12-04 05:24:54 24 4
gpt4 key购买 nike

在我们将数据写入磁盘之前有页面缓存。

所以如果我有两个操作。

write(fileA)
write(fileB)

然后如果系统突然关机。 我们不主动调用sync() 调用。

我想知道有没有可能我们写到fileB的数据已经flush到了磁盘,而我们写到fileA的数据还没有flush到磁盘?

最佳答案

我相信 fileB 在 fileA 之前写入磁盘是可能的,因为写入将被捆绑到块 I/O 请求中,并且可以由 I/O 调度程序在块设备层重新排序,以尽量减少磁盘搜索.

有关 I/O 调度程序(电梯)的更多信息,请参阅内核文档:
http://lxr.free-electrons.com/source/Documentation/block/biodoc.txt#L885

关于linux-kernel - linux页面缓存刷新顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26707442/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com