DiskSim中parfile的参数设置
parfile文件以.parf为后缀,可在valid文件夹中找到示例。参数配置文件主要包括以下几部分:
1. 设置该工程的系统背景参数
disksim_global { }:Global Block整个模拟工程全局参数
disksim_stats { iodriver、bus、ctlr、device、process flow }:Stats Block 整个模拟工程局部参数,显示、信息收集等
disksimiosim { }:iosim Block
2. 定义一系列设备
I/O SubsystemComponent Specifications:设备性能参数,包含很多block,其中会引用.diskspecs文件,.diskspecs文件中又会引用.model文件
3. 实例化,描述该工程的设备和结构
component instantiation:实例化,选择I/O Subsystem Component Specifications中定义的设备加入该工程
I/O SubsystemInterconnection Specifications:互联拓扑,描述实例的拓扑互联结构
4. 其它
disksimsyncset { }:Rotational Synchronization of Devices 设备转速和初始偏移是否同步,可有可无
disksimlogorg { }:Disk Array Data Organizations 磁盘阵列,数据逻辑组织形式,如striping或RAID
5. 当模拟不输入trace而需使用合成负载时,设置该以下两个参数block:
disksim_pf { }:Process-Flow Parameters 合成负载的一些参数
disksim_synthio { }:SyntheticWorkloads 合成负载
以下是一个例子:
其中有些参数是必须设置的(required),有些参数则是可选的(optional)
disksim_globalGlobal { # Global Block
Init Seed = 42, #每次模拟开始时会由randomnumber generator产生一个initial seed,决定系统configuration。若希望实验可还原,可使用相同的InitSeed
Real Seed = 42, #决定系统的workload的初始随机数,当保持Init Seed不变而改变Real Seed时,可得到相同系统configuration下不同workload的实验结果
# Statistic warm-up period = 0.0 seconds,
Stat definition file = statdefs #挂载配置文件,statdefs为一个文件名,该文件内定义了收集哪些数据,收集时的bin的大小
}
disksim_statsStats { # Stats Block,包含以下五个子块:iodriver、bus、ctlr、device、processflow,参数全由0或1表示
iodriver stats = disksim_iodriver_stats {
Print driver size stats = 1,
Print driver locality stats = 0,
Print driver blocking stats = 0,
Print driver interference stats = 0,
Print driver queue stats = 1,
Print driver crit stats = 1,
Print driver idle stats = 1,
Print driver intarr stats = 1,
Print driver streak stats = 1,
Print driver stamp stats = 1,
Print driver per-device stats = 1 },
bus stats = disksim_bus_stats {
Print bus idle stats = 1,
Print bus arbwait stats = 1 },
ctlr stats = disksim_ctlr_stats {
Print controller cache stats = 1,
Print controller size stats = 1,
Print controller locality stats = 1,
Print controller blocking stats = 1,
Print controller interference stats = 1,
Print controller queue stats = 1,
Print controller crit stats = 1,
Print controller idle stats = 1,
Print controller intarr stats = 1,
Print controller streak stats = 1,
Print controller stamp stats = 1,
Print controller per-device stats = 1 },
device stats = disksim_device_stats {
Print device queue stats = 0,
Print device crit stats = 0,
Print device idle stats = 0,
Print device intarr stats = 0,
Print device size stats = 0,
Print device seek stats = 1,
Print device latency stats = 1,
Print device xfer stats = 1,
Print device acctime stats = 1,
Print device interfere stats = 0,
Print device buffer stats = 1 },
process flow stats = disksim_pf_stats {
Print per-process stats = 1,
Print per-CPU stats = 1,
Print all interrupt stats = 1,
Print sleep stats = 1
}
} # end of statsblock
#下面进入I/OSubsystem Component Specifications,进行具体设备的参数设定,包含4块:device driver,buses,controller,storage device
disksim_iodriverDRIVER0 { #Device Drivers
type = 1,
Constantaccess time = 0.0, #决定每个request的访问时间和队列时间是否一致,还是由下面disk根据自身情况自行计算
Scheduler =disksim_ioqueue { #Queue/Scheduler Subcomponents
Scheduling policy = 1, #Scheduling算法,如何选择下一个处理哪个request,1代表“先来先服务”,其它如“Shortest-Seek-Time-First (SSTF)”等
Cylinder mapping strategy = 1, #schedule可感知的request的粒度,能否感知到柱面(磁盘每个盘面上有多少磁道)、sector扇区等
Write initiation delay = 0.0, #写延迟
Read initiation delay = 0.0, #读延迟
Sequential stream scheme = 0, #对连续读写是否调度到一起执行
Maximum concat size = 128, #出于优化,可能将多个request调度到一起连续执行,但调度到一起的request读写总和最大不可超过此上限
Overlapping request scheme = 0, #如何对待重叠的request
Sequential stream diff maximum = 0, #一个sequential stream中允许的最大间隔,超出此间隔的两个request不能在算作同一个stream中
Scheduling timeout scheme = 0, #Muti-queue时,对等待时间很长是否调度到更高优先级队列
Timeout time/weight = 6,
Timeout scheduling = 4, #对timeout queue中的request的调度算法,如何选择下一个执行的request
Scheduling priority scheme = 0, #标识(flag)优先级高的request是否自动调度到highest-priority queue
Priority scheduling = 4
}, # end of Scheduler
Use queueing in subsystem = 1
} # end of DRV0 spec
disksim_bus BUS0 { #Buses
type = 1, #bus是否由一家独占所有带宽(可以轮流时分独占),还是多家并行共享带宽
Arbitration type = 1, #当bus带宽有一家独占时,仲裁bus归属的方法,slot-based priority(SCSI)或 “先来先服务”
Arbitration time = 0.0, #仲裁时间开销
Read block transfer time = 0.0, #读传输时间
Write block transfer time = 0.0, #写传输时间
Print stats = 0
} # end of BUS0 spec
disksim_bus BUS1 { #Buses
type = 1,
Arbitration type = 1,
Arbitration time = 0.0,
Read block transfer time = 0.17010,
Write block transfer time = 0.18686,
Print stats = 1
} # end of BUS1 spec
disksim_ctlrCTLR0 { #Controllers
type = 1, #类型,1表示简单简单控制器,仅相当于bus之间的bridge
Scale for delays = 0.0, #控制器引发的延迟
Bulk sector transfer time = 0.0, #block在控制器中的传输时间
Maximum queue length = 0, #控制器内的最大排队时间
Print stats = 1
} # end of CTLR0 spec
# HP_C2247A_validate
source hp_c2247a.diskspecs # Disks设置详细描述了某种disk设备的性能,由于较大,通常写在专门的.diskspecs文件中,如本例为hp_c2247a.diskspecs。在.diskspecs文件中又会引用.model,描述disk的一些底层属性。
# component instantiation 设备参数设置完毕,开始实例化
instantiate [ statfoo ] as Stats
instantiate [bus0 ] as BUS0
instantiate [ bus1 ] as BUS1
instantiate [ disk0 ] as HP_C2247A_validate
instantiate [ driver0 ] as DRIVER0
instantiate [ ctlr0 ] as CTLR0
# system topology
topologydisksim_iodriver driver0 [ #I/O SubsystemInterconnection Specifications 互联拓扑
disksim_bus bus0 [
disksim_ctlr ctlr0 [
disksim_bus bus1 [
disksim_disk disk0 []
] # end of bus1
] # end of ctlr0
] # end of bus0
] # end of system topology
# no syncsets 无RotationalSynchronization of Devices
disksim_logorgorg0 { #Disk Array DataOrganizations 磁盘阵列 数据逻辑组织形式
Addressing mode = Parts, #是否编成一个统一逻辑设备
Distribution scheme = Asis, #分布策略,体现负载均衡能力
Redundancy scheme = Noredun, #冗余策略
devices = [ disk0 ], #该逻辑磁盘阵列包含哪些disk
Stripe unit = 2054864,
Synch writes for safety = 0,
Number of copies = 2, #副本数(Redundancy scheme设为shadowed时才有效)
Copy choice on read = 6, #哪个副本负责响应(Redundancy scheme设为shadowed时才有效)
RMW vs. reconstruct = 0.5,
Parity stripe unit = 64, #(Redundancy scheme设为Parity_rotated时才有效)
Parity rotation type = 1, #(Redundancy scheme设为Parity_rotated时才有效)
Time stamp interval = 0.000000,
Time stamp start time = 60000.000000,
Time stamp stop time = 10000000000.000000,
Time stamp file name = stamps
} # end of logorg org0 spec
#下面设置workload,可有多可generator,每个generator每过一段think time后发出一个request,包括time-criticalreques(generator需等上一个request完成再进入下一个think time)
disksim_pfProc { # Process-Flow Parameters
Number of processors = 1,
Process-Flow Time Scale = 1.0
} # end of process flow spec
disksim_synthioSynthio { # SyntheticWorkloads
Number of I/O requests to generate = 10000, #共产生多少request
Maximum time of trace generated = 1000.0, #generator生命时间
System call/return with each request = 0, #request是否引发上层系统call或return
Think time from call to request = 0.0,
Think time from request to return = 0.0,
Generators = [
disksim_synthgen { # generator 0
Storage capacity per device = 2054864, #可被request的地址数
devices = [ disk0 ], #可被request的设备
Blocking factor = 8, #request的粒度,所有request的访问地址必须是其倍数
Probability of sequential access = 0.0, #出现下一request的地址起始位置正好是上一request的地址结束位置的概率
Probability of local access = 0.0, #出现下一request的地址起始位置正好是上一request的地址起始和结束位置之间的概率
Probability of read access = 0.66,
Probability of time-critical request = 1.0, # time-critical request的概率
Probability of time-limited request = 0.0, # generator先等一个time-limit think time,再等上一个request完成,再进入下一个think time
Time-limited think times = [ normal, 30.0, 100.0 ],
General inter-arrival times = [ exponential, 0.0, 0.0 ], #下一request地址与上一request不连续时的think time
Sequential inter-arrival times = [ normal, 0.0, 0.0 ], #下一request地址与上一request连续时的think time
Local inter-arrival times = [ exponential, 0.0, 0.0 ], #下一request地址位于上一request内时的think time
Local distances = [ normal, 0.0, 40000.0 ], #当生成local request时,下一request距上一request起始地址的距离
Sizes = [ exponential, 0.0, 8.0 ] #request size
} # end of generator 0
] # end of generator list
} # end of synthetic workload spec
集体请参考官方手册 The DiskSim Simulation Environment