首先感谢Hao Chen博客记录的内容。笔者对于DiskSim没有接触,第一次成功安装全是按照前人博客完成。相对而言DiskSim + SSD extent的编译流程还是比较复杂,设计源码和make文件的大量改动。前人栽树后人乘凉,已经有现成的patch文件,避免了我们手动改动代码,不仅耗时还容易出错。

再次感谢!!

笔者使用的系统介绍:centos7.6-64bit,内核版本5.8.6,编译器为4.8.5

安装依赖

  • linux 如没安装flex、bison的话,先要安装。
1
$sudo yum install bison flex -y
  • 下载源码包

disksim 4.0: http://www.pdl.cmu.edu/DiskSim/
SSD extension: http://research.microsoft.com/en-us/downloads/b41019e2-1d2b-44d8-b512-ba35ab814cd4/

解压安装包

1
2
3
$ tar xfz disksim-4.0-with-dixtrac.tar.gz
$ cd disksim-4.0
$ unzip ../ssd-add-on.zip

补丁

补丁为:从Hao Chen的github上下载的相关patch文件。

点击链接,下载 ‘modify-patch’‘64bit-patch’。下载好后将 modify-patch64bit-patch 这两个文件都放到 disksim-4.0 路径下。

step1. 集成 ssdmodel

1
patch -p1 < ssdmodel/ssd-patch

step2. 修改文件

1
patch -p1 < modify-patch

如果只想在 32 位系统上运行的话,step3可以跳过,直接 make 就行了。

step3. 兼容64位的补丁

1
patch -p1 < 64bit-patch

make

1
$ make

运行

step1. 测试disksim能否顺利执行。

1
2
$ cd valid
$ ./runvalid

正常运行,输出如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
These results represent actual drive validation experiments

QUANTUM_QM39100TD-SW (rms should be about 0.378)
rms = 0.378078

SEAGATE_ST32171W (rms should be about 0.349)
rms = 0.347863

SEAGATE_ST34501N (rms should be about 0.318)
rms = 0.318228

SEAGATE_ST39102LW (rms should be about 0.107)
rms = 0.107098

step2. 测试ssd extension的脚本能否顺利执行。

1
2
3
$ chmod a+x ../ssdmodel/valid/runvalid
$ cd ../ssdmodel/valid
$ ./runvalid

正常运行,输出如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---Running tests with the synthetic workload generator---

Sequential read (250K I/Os): average SSD response time should be around 0.132 ms
ssd Response time average: 0.132511
Sequential write (250K I/Os): average SSD response time should be around 0.310 ms
ssd Response time average: 0.310895
Sequential write (5M I/Os): average SSD response time should be around 0.334 ms
ssd Response time average: 0.334365
Random read (250K I/Os): average SSD response time should be around 0.136 ms
ssd Response time average: 0.136118
Random write (250K I/Os): average SSD response time should be around 0.329 ms
ssd Response time average: 0.329458
Random write (5M I/Os): average SSD response time should be around 0.593 ms
ssd Response time average: 0.593438
---Running tests with the real traces---

IOzone: average SSD response time should be around 6.394276 ms
ssd Response time average: 6.394276
Postmark: average SSD response time should be around 4.140330 ms
ssd Response time average: 4.140330