62 .cc_cylinders = 107500,
64 .cc_cylinder_skew = 0,
65 .cc_sectors_min = 680,
66 .cc_sectors_max = 2040,
68 .cc_seek_avg = 3400000,
69 .cc_seek_track_to_track = 200000,
70 .cc_seek_full_stroke = 6600000,
71 .cc_write_settle = 220000,
73 .cc_command_latency = 0,
84 .cc_cylinders = 153352,
86 .cc_cylinder_skew = 76,
87 .cc_sectors_min = 1220,
88 .cc_sectors_max = 1800,
89 .cc_cyl_in_zone = 48080,
91 .cc_seek_avg = 8500000,
92 .cc_seek_track_to_track = 800000,
93 .cc_seek_full_stroke = 16000000,
94 .cc_write_settle = 500000,
95 .cc_head_switch = 500000,
96 .cc_command_latency = 0,
106 static double seekto(
struct sim *
s, int64_t sector,
int sectors)
112 return (
s->ss_bolt - now)/1000;
124 int64_t in_num_sect = -1;
136 in_num_sect = 1953525168;
142 sector = in_num_sect *
i /
LBA_D;
143 for (sectors = 1; sectors <= (1 << 16); sectors *= 2) {
148 for (avg = sqr = 0.0, round = 0; round <
ROUNDS; ++round) {
149 latency =
seekto(
s, sector, sectors);
151 sqr += latency*latency;
154 printf(
"reading %4i sectors at %i/%i: %6.0f (%6.0f)\n",
156 sqrt(sqr/
ROUNDS - avg*avg));
163 for (round = 0; round <
ROUNDS; ++round) {
165 for (j = 0; j <
LBA_D; ++j) {
169 sector_from = in_num_sect *
i /
LBA_D;
170 sector_to = in_num_sect * j /
LBA_D;
175 for (k = 0; k <
TRACK_D; ++k) {
178 latency =
seekto(
s, sector_to +
181 seeklat[
i][j] += latency;
182 seeksqr[
i][j] += latency*latency;
190 for (j = 0; j <
LBA_D; ++j) {
192 printf(
"[%6.0f %4.0f]", latency,
199 for (j = 0; j <
LBA_D; ++j)
213 int main(
int argc,
char **argv)
M0_INTERNAL void sim_thread_init(struct sim *state, struct sim_thread *thread, unsigned stacksize, sim_func_t func, void *arg)
static int seek_test_start(struct sim_callout *co)
M0_INTERNAL void sim_init(struct sim *state)
static struct chs_conf ST31000640SS
static struct chs_dev disc
static struct sim_thread seek_thr
M0_INTERNAL void elevator_init(struct elevator *el, struct storage_dev *dev)
static void seek_test_thread(struct sim *s, struct sim_thread *t, void *arg)
M0_INTERNAL void sim_log(struct sim *s, enum sim_log_level level, const char *format,...)
int m0_init(struct m0 *instance)
M0_INTERNAL void sim_thread_exit(struct sim_thread *thread)
M0_INTERNAL void sim_run(struct sim *state)
M0_INTERNAL void chs_conf_init(struct chs_conf *conf)
static struct m0_thread t[8]
M0_INTERNAL void sim_timer_add(struct sim *state, sim_time_t delta, sim_call_t *cfunc, void *datum)
unsigned long long sim_time_t
M0_INTERNAL void elevator_io(struct elevator *el, enum storage_req_type type, sector_t sector, unsigned long count)
static double seekto(struct sim *s, int64_t sector, int sectors)
struct storage_conf cc_storage
M0_INTERNAL void cnt_dump_all(void)
M0_INTERNAL void chs_dev_init(struct chs_dev *dev, struct sim *sim, struct chs_conf *conf)
struct storage_dev cd_storage
static struct elevator el
M0_INTERNAL void sim_fini(struct sim *state)
static struct m0_addb2_source * s
int main(int argc, char **argv)