I/O请求在Linux内核中的工作方式
再会!我可以关于I/O如何在低级上工作有一个疑问吗?更具体地说,我的问题是在一个I/O请求中可以处理多少个字节? 例如,如果我们逐行读取输入文档(假设包含10行的文档),则Linux内核将使用一条I/O请求提交所有10行,或者它将单独提交10个I/O请求?预先感谢您的任何评论或建议。
Good day! May I have a question about how I/O works on low-level? More specifically, my question is how many bytes can be handled in the one I/O requests?
For example, if we read an input document line by line (let's say a document containing 10 lines), the Linux kernel will submit all 10 lines using one I/O request or it will submit 10 I/O request separately? Thank you in advance for any comments or suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚遇到了这个问题。让我根据Linux内核概述IO层。
用户空间
内核
如果执行多行读取,则对内核进行多个系统调用。内核中的文件系统可能会从页面缓存中获取数据,或者读取到磁盘的问题。
Just came across this question. Let me give an overview of the layers of IO as per Linux kernel.
Userspace
Kernel
If you perform multiple lines read then you do multiple system call to kernel. The filesystem in kernel may fetch the data from page cache, or issues read to the disk.