storage device direct io

Format
Plain text
Post date
2017-04-19 11:58
Publication Period
Unlimited
  1. http://blog.csdn.net/vah101/article/details/6526659
  2. Direct IO
  3. Direct I/O就是当一个进程对系统文件进行IO操作的时候越过系统的文件写缓冲区和读缓存区。
  4. 文件系统缓冲区:当系统读写块设备,为了加快读写速度,系统维护了一个块缓冲区。当系统读
  5. 数据的时候,先去缓冲区中读,如果没有,再读写磁盘。当系统写数据的时候,先写数据到缓冲
  6. 区中。
  7. Oracle 数据库本身已经有自己的数据缓冲区,如果再加上系统文件的缓冲区。数据就被缓冲了俩
  8. 次,系统的内存就被浪费了。而且如果Oracle的数据库 的块比系统文件的块小,那么就会造成系
  9. 统的浪费。比如Oracle的块大小是8K,系统文件的块大小是16K,那么Oracle单个读写一次就浪费
  10. 了8K的资源。
  11. https://msdn.microsoft.com/en-us/library/windows/hardware/ff565372(v=vs.85).aspx
  12. Using Direct I/O
  13. Drivers for devices that can transfer large amounts of data at a time should use direct I/O for those transfers. Using direct I/O for large transfers improves a driver's performance, both by reducing its interrupt overhead and by eliminating the memory allocation and copying operations inherent in buffered I/O.
  14. Generally, mass-storage device drivers request direct I/O for transfer requests, including lowest-level drivers that use direct memory access (DMA) or programmed I/O (PIO), as well as any intermediate drivers chained above them.
  15. The I/O manager determines that an I/O operation is using direct I/O as follows:
  16. https://www.ibm.com/developerworks/cn/linux/l-cn-directio/index.html
  17. Linux 中直接 I/O 机制的介绍
  18. 对于传统的操作系统来说,普通的 I/O 操作一般会被内核缓存,这种 I/O 被称作缓存 I/O。本文所介绍的文件访问机制不经过操作系统内核的缓存,数据直接在磁盘和应用程序地址空间进行传输,所以该文件访问的机制称作为直接 I/O。Linux 中就提供了这样一种文件访问机制,对于那种将 I/O 缓存存放在用户地址空间的应用程序来说,直接 I/O 是一种非常高效的手段。本文将基于 2.6.18 版本的内核来讨论 Linux 中直接 I/O 的技术的设计与实现。
다운로드 Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text