硬盘IO性能测试---总结

  1. dd命令的调用流程

5d9051c0g7803ac63df4c&690

上图中的f_op数据结构是在open一个文件或设备时赋值的,其中的read, write等指向真正的操作该文件的函数。通过这个流程图,我们可以看出该设备或文件的驱动实现了标准的读写函数,就可以利用dd进行读写

./ktap -s scsi:scsi_dispatch_cmd_done

同时运行dd命令,进行写操作

#dd if=/dev/zero of=test bs=1024 count=10

ktap跟踪的输出结果如下:

  1. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=127 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345327616 txlen=1024 protect=0 raw=2a 00 14 95 48 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  2. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345328640 txlen=1024 protect=0 raw=2a 00 14 95 4c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  3. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345329664 txlen=1024 protect=0 raw=2a 00 14 95 50 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  4. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345330688 txlen=1024 protect=0 raw=2a 00 14 95 54 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  5. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345331712 txlen=1024 protect=0 raw=2a 00 14 95 58 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  6. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345332736 txlen=1024 protect=0 raw=2a 00 14 95 5c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  7. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=127 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345333760 txlen=1024 protect=0 raw=2a 00 14 95 60 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  8. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345334784 txlen=1024 protect=0 raw=2a 00 14 95 64 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  9. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345335808 txlen=1024 protect=0 raw=2a 00 14 95 68 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  10. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345336832 txlen=1024 protect=0 raw=2a 00 14 95 6c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  11. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345337856 txlen=1024 protect=0 raw=2a 00 14 95 70 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  12. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345338880 txlen=1024 protect=0 raw=2a 00 14 95 74 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  13. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345339904 txlen=1024 protect=0 raw=2a 00 14 95 78 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  14. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345340928 txlen=1024 protect=0 raw=2a 00 14 95 7c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  15. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345341952 txlen=1024 protect=0 raw=2a 00 14 95 80 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  16. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345342976 txlen=1024 protect=0 raw=2a 00 14 95 84 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  17. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345344000 txlen=1024 protect=0 raw=2a 00 14 95 88 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  18. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345345024 txlen=1024 protect=0 raw=2a 00 14 95 8c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  19. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=116 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345346048 txlen=1024 protect=0 raw=2a 00 14 95 90 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  20. 6       0       swapper/6       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=63 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(WRITE_10 lba=345347072 txlen=1024 protect=0 raw=2a 00 14 95 94 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)


通过读取lba数值,可以查看到地址是连续的,从而可以得知dd在写数据过程是连续的IO;

在来看看读操作

输入dd命令

  1. #dd iflag=direct,nonblock if=test of=/dev/zero bs=1M count=10

  1. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345327616 txlen=1024 protect=0 raw=28 00 14 95 48 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  2. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345328640 txlen=1024 protect=0 raw=28 00 14 95 4c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  3. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345329664 txlen=1024 protect=0 raw=28 00 14 95 50 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  4. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345330688 txlen=1024 protect=0 raw=28 00 14 95 54 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  5. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345331712 txlen=1024 protect=0 raw=28 00 14 95 58 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  6. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345332736 txlen=1024 protect=0 raw=28 00 14 95 5c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  7. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345333760 txlen=1024 protect=0 raw=28 00 14 95 60 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  8. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345334784 txlen=1024 protect=0 raw=28 00 14 95 64 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  9. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345335808 txlen=1024 protect=0 raw=28 00 14 95 68 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  10. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345336832 txlen=1024 protect=0 raw=28 00 14 95 6c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  11. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345337856 txlen=1024 protect=0 raw=28 00 14 95 70 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  12. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345338880 txlen=1024 protect=0 raw=28 00 14 95 74 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  13. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345339904 txlen=1024 protect=0 raw=28 00 14 95 78 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  14. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345340928 txlen=1024 protect=0 raw=28 00 14 95 7c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  15. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345341952 txlen=1024 protect=0 raw=28 00 14 95 80 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  16. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345342976 txlen=1024 protect=0 raw=28 00 14 95 84 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  17. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345344000 txlen=1024 protect=0 raw=28 00 14 95 88 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  18. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345345024 txlen=1024 protect=0 raw=28 00 14 95 8c 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  19. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=128 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345346048 txlen=1024 protect=0 raw=28 00 14 95 90 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)
  20. 1       0       swapper/1       scsi_dispatch_cmd_done: host_no=0 channel=1 id=0 lun=0 data_sgl=117 prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=345347072 txlen=1024 protect=0 raw=28 00 14 95 94 00 00 04 00 00) result=(driver=DRIVER_OK host=DID_OK message=COMMAND_COMPLETE status=SAM_STAT_GOOD)

通过读取lba数值,可以看到dd的读io也是顺序的!

从而证明了dd在默认情况下是进行顺序读写测试的。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值