Direct I/O,Synchronous I/O的概念

Direct I/O概念:

Direct I/O is a way to avoid entire caching layer in the kernel and send the I/O directly to the disk.

想要使用direct io的模式,可以这样做:

Opens files with O_DIRECT flag.


Synchronous I/O概念:

Synchronous I/O is any I/O (system I/O with or without O_DIRECT, or stream I/O) performed to a file descriptor that was opened using the O_SYNC or O_DSYNC flags.


几个Flag的区别:

O_DIRECT  I/O operations performed against files opened with O_DIRECT bypass the kernel's page cache, writing directly to the storage.
O_SYNC File data and all file metadata are written synchronously to disk.
O_DSYNC     Only file data and metadata needed to access the file data are written synchronously to disk. Metadata that is not required for retrieving the data of the file may not be written immediately.


参考资料

===============

What is direct I/O anyway?

http://www.alexonlinux.com/what-is-direct-io-anyway 

Ensuring data reaches disk

https://lwn.net/Articles/457667/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值