CFQ IO 调度程序请求队列
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
同步请求是指进程在完成之前被阻塞的请求,异步请求是指进程在完成之前可以并行继续的请求。
通常,程序进行的所有正常读取都是同步的,因为在获得所请求的数据之前,进程无法前进。然而,写入本质上通常是异步的 - 只要保证进程看到它已执行的所有写入(由缓冲区/页面缓存负责),进程并不关心数据何时实际写入存储设备一旦它调用了 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...