CFQ IO 调度程序请求队列

发布于 2024-12-26 01:28:52 字数 179 浏览 2 评论 0原文

Linux 中的 CFQ IO 调度程序有一组请求队列。来自进程的同步请求进入单独的每个进程请求队列,而所有异步请求进入一组共享队列。

请求如何分类为同步或异步?在这种情况下异步是否意味着使用内核 AIO 完成 IO? (以及所有其他正常的 read()/write() 和缓冲的 fread()/fwrite() 被视为同步)

The CFQ IO scheduler in Linux has a set of request queues.The synchronous requests from processes go into separate per process request queues while all asynchronous requests go into a set of shared queues.

How are requests classified as synchronous or asynchronous? Does asynchronous in this context mean IO done using kernel AIO? ( and all other normal read()/write() and buffered fread()/fwrite() being counted as synchronous)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

从﹋此江山别 2025-01-02 01:28:52

同步请求是指进程在完成之前被阻塞的请求,异步请求是指进程在完成之前可以并行继续的请求。

通常,程序进行的所有正常读取都是同步的,因为在获得所请求的数据之前,进程无法前进。然而,写入本质上通常是异步的 - 只要保证进程看到它已执行的所有写入(由缓冲区/页面缓存负责),进程并不关心数据何时实际写入存储设备一旦它调用了 write 系统调用。

从那时起它就变得复杂了: fsync() 系统调用是同步请求,对于日志文件系统上的某些元数据更改调用也是如此,但在非日志文件系统上则不然......

Synchronous requests are those the process is blocked until they complete, asynchronous requests are those that the process can continue in parallel to their completion.

Typically, all normal reads a program makes are synchronous since the process cannot advance until it has the data it requested. Writes however are most often asynchronous by nature - as long as the process is guaranteed to see all writes it has performed, which is taken care by the buffer/page cache, the process does not care when the data is actually written to the storage device once it has called the write system call.

From there on it gets complicated: an fsync() system call is a synchronous request and the same is true for some meta data changing calls on journalled file systems, but not on non journalled ones and so on...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文