📄 disk.modspec
字号:
# DiskSim Storage Subsystem Simulation Environment (Version 3.0)# Revision Authors: John Bucy, Greg Ganger# Contributors: John Griffin, Jiri Schindler, Steve Schlosser## Copyright (c) of Carnegie Mellon University, 2001, 2002, 2003.## This software is being provided by the copyright holders under the# following license. By obtaining, using and/or copying this software,# you agree that you have read, understood, and will comply with the# following terms and conditions:## Permission to reproduce, use, and prepare derivative works of this# software is granted provided the copyright and "No Warranty" statements# are included with all reproductions and derivative works and associated# documentation. This software may also be redistributed without charge# provided that the copyright and "No Warranty" statements are included# in all redistributions.## NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS.# CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER# EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED# TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY# OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE# MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT# TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.# COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE# OR DOCUMENTATION.MODULE diskPROTO struct disk *disksim_disk_loadparams(struct lp_block *b, int *num);PARAM Model BLOCK 1TEST result->model = dm_disk_loadparams(blk, 0)Parameters for the disk's libdiskmodel model. See the diskmodeldocumentation for details.PARAM Scheduler BLOCK 1 TEST (result->queue = (struct ioq *)disksim_ioqueue_loadparams(blk, device_printqueuestats, device_printcritstats, device_printidlestats, device_printintarrstats, device_printsizestats))# INIT ioqueue_initialize(result->queue, 0);An ioqueue; see Section \ref{param.queue}PARAM Max queue length I 1 TEST i >= 0INIT result->maxqlen = i;This specifies the maximum number of requests that the disk can have inservice or queued for service at any point in time. Duringinitialization, other components request this information and respectit during simulation.PARAM Bulk sector transfer time D 1 TEST d >= 0.0INIT result->blktranstime = d;This specifies the time for the disk to transfer a single 512-byte blockover the bus. Recall that this value is compared with thecorresponding bus and controller block transfer values to determinethe actual transfer time (i.e.,~the maximum of the three values).PARAM Segment size (in blks) I 1 TEST RANGE(i, 1, result->model->dm_sectors)INIT result->segsize = i;This specifies the size of each buffer segment, assuming a static segmentsize. Some modern disks will dynamically resize their buffer segments(and thereby alter the number of segments) to respond to perceivedpatterns of workload behavior, but DiskSim does not currently supportthis functionality.PARAM Number of buffer segments I 1 TEST i >= 0INIT result->numsegs = i;This specifies the number of segments in the on-board buffer/cache. Abuffer segment is similar to a cache line, in that each segmentcontains data that is disjoint from all other segments. However,segments tend to be organized as circular queues of logicallysequential disk sectors, with new sectors pushed into an appropriatequeue either from the bus (during a write) or from the disk media(during a read). As data are read from the buffer/cache and eithertransferred over the bus (during a read) or written to the disk media(during a write), they are eligible to be pushed out of the segment(if necessary or according to the dictates of the buffer/cachemanagement algorithm).PARAM Print stats I 1 TEST RANGE(i,0,1)INIT result->printstats = i;This specifies whether or not statistics for the disk will be reported.PARAM Per-request overhead time D 1 TEST d >= 0.0INIT result->overhead = d;This specifies a per-request processing overhead that takes placeimmediately after the arrival of a new request at the disk. It isadditive with various other processing overheads described below, butin general either the other overheads are set to zero or thisparameter is set to zero.PARAM Time scale for overheads D 1 TEST d >= 0.0INIT result->timescale = d;This specifies a multiplicative scaling factor for all processing overheadtimes. For example, 0.0 eliminates all such delays, 1.0 uses them atface value, and 1.5 increases them all by 50\%.PARAM Hold bus entire read xfer I 1 TEST RANGE(i,0,1)INIT result->hold_bus_for_whole_read_xfer = i;This specifies whether or not the disk retains ownership of the busthroughout the entire transfer of ``read'' data from the disk. Iffalse~(0), the disk may release the bus if and when the currenttransfer has exhausted all of the available data in the on-boardbuffer/cache and must wait for additional data sectors to be read offthe disk into the buffer/cache.PARAM Hold bus entire write xfer I 1 TEST RANGE(i,0,1)INIT result->hold_bus_for_whole_write_xfer = i;This specifies whether or not the disk retains ownership of the busthroughout the entire transfer of ``write'' data to the disk. Iffalse~(0), the disk may release the bus if and when the currenttransfer has filled up the available space in the on-boardbuffer/cache and must wait for data from the buffer/cache to bewritten to the disk.PARAM Allow almost read hits I 1 TEST RANGE(i,0,1)INIT result->almostreadhits = i;This specifies whether or not a new read request whose first block iscurrently being prefetched should be treated as a partial cache hit.Doing so generally means that the request is handled right away.PARAM Allow sneaky full read hits I 1 TEST RANGE(i,0,1)INIT result->sneakyfullreadhits = i;This specifies whether or not a new read request whose data are entirelycontained in a single segment of the disk cache is allowed toimmediately transfer that data over the bus while another request ismoving the disk actuator and/or transferring data between the diskcache and the disk media. In essence, the new read request ``sneaks''its data out from the disk cache without interrupting the current(active) disk request.PARAM Allow sneaky partial read hits I 1 TEST RANGE(i,0,1)INIT result->sneakypartialreadhits = i;This specifies whether or not a new read request whose data are partiallycontained in a single segment of the disk cache is allowed toimmediately transfer that data over the bus while another request ismoving the disk actuator and/or transferring data between the diskcache and the disk media. In essence, the new read request ``sneaks''the cached portion of its data out from the disk cache withoutinterrupting the current (active) disk request.PARAM Allow sneaky intermediate read hits I 1 TEST RANGE(i,0,1)INIT result->sneakyintermediatereadhits = i;This specifies whether or not the on-board queue of requests is searchedduring idle bus periods in order to find read requests that may bepartially or completely serviced from the current contents of the diskcache. That is, if the current (active) request does not need busaccess at the current time, and the bus is available for use, a queuedread request whose data are in the cache may obtain access to the busand begin data transfer. ``Full'' intermediate read hits are givenprecedence over ``partial'' intermediate read hits.PARAM Allow read hits on write data I 1 TEST RANGE(i,0,1)INIT result->readhitsonwritedata = i;This specifies whether or not data placed in the disk cache by writerequests are considered usable by read requests. If false~(0), suchdata are removed from the cache as soon as they have been copied tothe media.PARAM Allow write prebuffering I 1 TEST RANGE(i,0,1)INIT result->writeprebuffering = i;This specifies whether or not the on-board queue of requests is searchedduring idle bus periods for write requests that could have part or allof their data transferred to the on-board cache (without disturbing anongoing request). That is, if the current (active) request does notneed bus access at the current time, and the bus is available for use,a queued write request may obtain access to the bus and begin datatransfer into an appropriate cache segment. Writes that arecontiguous to the end of the current (active) request are givenhighest priority in order to facilitate continuous transfer to themedia, followed by writes that have already ``prebuffered'' someportion of their data.PARAM Preseeking level I 1 TEST RANGE(i,0,2)INIT result->preseeking = i;This specifies how soon the actuator is allowed to start seeking towardsthe media location of the next request's data. 0~indicates no preseeking, meaning that the actuator does not beginrelocation until the current request's completion has been confirmedby the controller (via a completion ``handshake'' over the bus).1~indicates that the actuator can begin relocation as soon as thecompletion message has been prepared for transmission by the disk.2~indicates that the actuator can begin relocation as soon as theaccess of the last sector of the current request (and any requiredprefetching) has been completed. This allows greater parallelismbetween bus activity and mechanical activity.PARAM Never disconnect I 1 TEST RANGE(i,0,1)INIT result->neverdisconnect = i;This specifies whether or not the disk retains ownership of the bus duringthe entire processing and servicing of a request (i.e.,~from arrivalto completion). If false~(0), the disk may release the bus wheneverit is not needed for transferring data or control information.PARAM Avg sectors per cylinder I 1 TEST RANGE(i,1,result->model->dm_sectors)INIT result->sectpercyl = i;This specifies (an approximation of) the mean number of sectors percylinder. This value is exported to any externalschedulers\footnote{Some scheduling algorithms available in DiskSimutilize approximations of the actual layout of data on the disk(s)when reordering disk requests.} requesting it and is not used by thedisk itself.PARAM Maximum number of write segments I 1 DEPEND Number of buffer segmentsTEST RANGE(i,1,result->numsegs)INIT result->numwritesegs = i;This specifies the number of cache segments available for holding``write'' data at any point in time. Because write-back caching istypically quite limited in current disk cache management schemes, somecaches only allow a subset of the segments to be used to hold data forwrite requests (in order to minimize any interference with sequentialread streams).PARAM Use separate write segment I 1 TEST RANGE(i,0,1)# WTF?!INIT result->dedicatedwriteseg = (segment *)i;This specifies whether or not a single segment is statically designatedfor use by all write requests. This further minimizes the impact ofwrite requests on the caching/prefetching of sequential read streams.PARAM Low (write) water mark D 1 TEST RANGE(d,0.0,1.0)INIT result->writewater = d;This specifies the fraction of segment size or request size (see below)corresponding to the {\it low water mark}. When data for a writerequest are being transferred over the bus into the buffer/cache, andthe buffer/cache segment fills up with ``dirty'' data, the disk maydisconnect from the bus while the buffered data are written to thedisk media. When the amount of dirty data in the cache falls belowthe low water mark, the disk attempts to reconnect to the bus tocontinue the interrupted data transfer.PARAM High (read) water mark D 1 TEST RANGE(d,0.0,1.0)INIT result->readwater = d;This specifies the fraction of segment size or request size (see below) corresponding to the {\it high water mark}. When data for a read request are being transferredover the bus from the buffer/cache, and the buffer/cache segment runs out ofdata to transfer, the disk may disconnect from the bus until additional dataare read from the disk media. When the amount of available data in the cache reaches the high water mark, the disk attempts to reconnect to the bus to continue the interrupted data transfer.PARAM Set watermark by reqsize I 1 TEST RANGE(i,0,1)INIT result->reqwater = i;This specifies whether the watermarks are computed as fractions of the individual request sizeor as fractions of the buffer/cache segment size.PARAM Calc sector by sector I 1 TEST RANGE(i,0,1)INIT result->sectbysect = i;This specifies whether or not media transfers should be computed sector bysector rather than in groups of sectors. This optimization has noeffect on simulation accuracy, but potentially results in shortersimulation times (at a cost of increased code complexity). It has notbeen re-enabled since the most recent modifications to DiskSim, so thesimulator currently functions as if the value were always true~(1).PARAM Enable caching in buffer I 1 TEST RANGE(i,0,2)INIT result->enablecache = i;This specifies whether or noton-board buffer segments are used for data caching as well as forspeed-matching between the bus and the disk media. Most (if not all) modern disk drives utilize their buffers as caches.PARAM Buffer continuous read I 1 TEST RANGE(i,0,4)INIT result->contread = i;This specifies the type of prefetching performed by the disk. 0~disablesprefetching. 1~enables prefetching up to the end of the trackcontaining the last sector of the read request. 2~enables prefetchingup to the end of the cylinder containing the last sector of the readrequest. 3~enables prefetching up to the point that the current cachesegment is full. 4~enables prefetching up to the end of the trackfollowing the track containing the last sector of the read request,provided that the current request was preceded in the not-too-distantpast by another read request that accessed the immediately previoustrack. In essence, the last scheme enables a type of prefetching thattries to stay one logical track ``ahead'' of any sequential readstreams that are detected.PARAM Minimum read-ahead (blks) I 1 TEST RANGE(i,0,result->segsize)INIT result->minreadahead = i;This specifies the minimum number of disk sectors that must be prefetchedafter a read request before servicing another (read or write) request.A positive value may be beneficial for workloads containing multipleinterleaved sequential read streams, but 0~is typically theappropriate value.PARAM Maximum read-ahead (blks) I 1 TEST RANGE(i,0,result->segsize)INIT result->maxreadahead = i;This specifies the maximum number of disk sectors that may be prefetchedafter a read request (regardless of all other prefetch parameters).PARAM Read-ahead over requested I 1 TEST RANGE(i,-1,1)INIT result->keeprequestdata = i;This specifies whether or not newly prefetched data can replace (in abuffer segment) data returned to the host as part of the most recentread request. % If false~(0), prefetch is %terminated when the buffer segment is% full.PARAM Read-ahead on idle hit I 1 TEST RANGE(i,0,1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -