Unix,Linux,Windows的IO架构

不同的操作系统其io架构是不同,想更好的优化IO问题,掌握系统的IO架构会非常有用;下面对操作系统的IO架构做下简单总结;

UNIX

上图为 unix 的IO 架构;

Application/DB:

此处是 IO 请求的起点;应用层的IO包括:

IOPS

吞吐量

IO大小

读比率

磁盘空间的大小

I/O system calls layer:此层由OS提供,并通过系统调用将应用的IO请求发送到存储;默认情况下,I/O的操作都同步的;目前许多操作系统已经提供异步IO;

File system layer:

文件系统是 操作系统用来以文件的方式 组织和管理 系统数据的,文件系统本身可以支持 buffered 或者unbuffered IO;

Volume manager layer:

用来将IO负载分散到不同的LUN上,

Multipathing/Disk layer:

多路径可以分为以下类型:hardware multipath

Software path

Operation multipath

FC adapter:与操作系统和 存储厂商有关;

Fabric layer: san中用来连接存储设备的和服务器的

Array:具体的存储;

 

WINDOWS:

Windows 的IO架构,与unix 类似,需要注意的是,windows 的文件系统和unix 并不通用;

 

Linux:

Linux中整个Io过程大致如下:

1. A process requests to write a file through the write() system call.

2. The kernel updates the page cache mapped to the file.

3. A pdflush kernel thread takes care of flushing the page cache to disk.

4. The filesystem layer puts each block buffer together to a bio struct (see 12.2.3, “Block

layer” on page 449) and submits a write request to the block device layer.

5. The block device layer gets requests from upper layers and performs an I/O elevator

operation and puts the requests into the I/O request queue.

6. A device driver, such as Small Computer System Interface (SCSI) or other device-specific

drivers, takes care of the write operation. The SCSI subsystem contains three layers:

upper layer (block, tape, and generic), midlayer (common SCSI operations), and device

driver layer. See 12.2.4, “I/O device driver” on page 450.

7. A disk device firmware performs hardware operations, such as seek head, rotation, and

data transfer to the sector on the platter.

以上只是对io的简单总结,如果有兴趣还可以参考mos文档,ixora.com,IBM redbook, 虚拟内存架构等资料,这样才能对整个IO有一个完整的理解;

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值