ztest.c (254112) | ztest.c (258632) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 172 unchanged lines hidden (view full) --- 181 .zo_init = 1, 182 .zo_time = 300, /* 5 minutes */ 183 .zo_maxloops = 50, /* max loops during spa_freeze() */ 184 .zo_metaslab_gang_bang = 32 << 10 185}; 186 187extern uint64_t metaslab_gang_bang; 188extern uint64_t metaslab_df_alloc_threshold; | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 172 unchanged lines hidden (view full) --- 181 .zo_init = 1, 182 .zo_time = 300, /* 5 minutes */ 183 .zo_maxloops = 50, /* max loops during spa_freeze() */ 184 .zo_metaslab_gang_bang = 32 << 10 185}; 186 187extern uint64_t metaslab_gang_bang; 188extern uint64_t metaslab_df_alloc_threshold; |
189extern uint64_t zfs_deadman_synctime; | 189extern uint64_t zfs_deadman_synctime_ms; |
190 191static ztest_shared_opts_t *ztest_shared_opts; 192static ztest_shared_opts_t ztest_opts; 193 194typedef struct ztest_shared_ds { 195 uint64_t zd_seq; 196} ztest_shared_ds_t; 197 --- 5125 unchanged lines hidden (view full) --- 5323static void * 5324ztest_deadman_thread(void *arg) 5325{ 5326 ztest_shared_t *zs = arg; 5327 spa_t *spa = ztest_spa; 5328 hrtime_t delta, total = 0; 5329 5330 for (;;) { | 190 191static ztest_shared_opts_t *ztest_shared_opts; 192static ztest_shared_opts_t ztest_opts; 193 194typedef struct ztest_shared_ds { 195 uint64_t zd_seq; 196} ztest_shared_ds_t; 197 --- 5125 unchanged lines hidden (view full) --- 5323static void * 5324ztest_deadman_thread(void *arg) 5325{ 5326 ztest_shared_t *zs = arg; 5327 spa_t *spa = ztest_spa; 5328 hrtime_t delta, total = 0; 5329 5330 for (;;) { |
5331 delta = (zs->zs_thread_stop - zs->zs_thread_start) / 5332 NANOSEC + zfs_deadman_synctime; | 5331 delta = zs->zs_thread_stop - zs->zs_thread_start + 5332 MSEC2NSEC(zfs_deadman_synctime_ms); |
5333 | 5333 |
5334 (void) poll(NULL, 0, (int)(1000 * delta)); | 5334 (void) poll(NULL, 0, (int)NSEC2MSEC(delta)); |
5335 5336 /* 5337 * If the pool is suspended then fail immediately. Otherwise, 5338 * check to see if the pool is making any progress. If 5339 * vdev_deadman() discovers that there hasn't been any recent 5340 * I/Os then it will end up aborting the tests. 5341 */ 5342 if (spa_suspended(spa)) { 5343 fatal(0, "aborting test after %llu seconds because " 5344 "pool has transitioned to a suspended state.", | 5335 5336 /* 5337 * If the pool is suspended then fail immediately. Otherwise, 5338 * check to see if the pool is making any progress. If 5339 * vdev_deadman() discovers that there hasn't been any recent 5340 * I/Os then it will end up aborting the tests. 5341 */ 5342 if (spa_suspended(spa)) { 5343 fatal(0, "aborting test after %llu seconds because " 5344 "pool has transitioned to a suspended state.", |
5345 zfs_deadman_synctime); | 5345 zfs_deadman_synctime_ms / 1000); |
5346 return (NULL); 5347 } 5348 vdev_deadman(spa->spa_root_vdev); 5349 | 5346 return (NULL); 5347 } 5348 vdev_deadman(spa->spa_root_vdev); 5349 |
5350 total += zfs_deadman_synctime; | 5350 total += zfs_deadman_synctime_ms/1000; |
5351 (void) printf("ztest has been running for %lld seconds\n", 5352 total); 5353 } 5354} 5355 5356static void 5357ztest_execute(int test, ztest_info_t *zi, uint64_t id) 5358{ --- 716 unchanged lines hidden (view full) --- 6075 spa_t *spa; 6076 char *cmd; 6077 boolean_t hasalt; 6078 char *fd_data_str = getenv("ZTEST_FD_DATA"); 6079 6080 (void) setvbuf(stdout, NULL, _IOLBF, 0); 6081 6082 dprintf_setup(&argc, argv); | 5351 (void) printf("ztest has been running for %lld seconds\n", 5352 total); 5353 } 5354} 5355 5356static void 5357ztest_execute(int test, ztest_info_t *zi, uint64_t id) 5358{ --- 716 unchanged lines hidden (view full) --- 6075 spa_t *spa; 6076 char *cmd; 6077 boolean_t hasalt; 6078 char *fd_data_str = getenv("ZTEST_FD_DATA"); 6079 6080 (void) setvbuf(stdout, NULL, _IOLBF, 0); 6081 6082 dprintf_setup(&argc, argv); |
6083 zfs_deadman_synctime = 300; | 6083 zfs_deadman_synctime_ms = 300000; |
6084 6085 ztest_fd_rand = open("/dev/urandom", O_RDONLY); 6086 ASSERT3S(ztest_fd_rand, >=, 0); 6087 6088 if (!fd_data_str) { 6089 process_options(argc, argv); 6090 6091 setup_data_fd(); --- 188 unchanged lines hidden --- | 6084 6085 ztest_fd_rand = open("/dev/urandom", O_RDONLY); 6086 ASSERT3S(ztest_fd_rand, >=, 0); 6087 6088 if (!fd_data_str) { 6089 process_options(argc, argv); 6090 6091 setup_data_fd(); --- 188 unchanged lines hidden --- |