Print this page
4045 zfs write throttle & i/o scheduler performance work
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ztest/ztest.c
          +++ new/usr/src/cmd/ztest/ztest.c
↓ open down ↓ 176 lines elided ↑ open up ↑
 177  177          .zo_killrate = 70,              /* 70% kill rate */
 178  178          .zo_verbose = 0,
 179  179          .zo_init = 1,
 180  180          .zo_time = 300,                 /* 5 minutes */
 181  181          .zo_maxloops = 50,              /* max loops during spa_freeze() */
 182  182          .zo_metaslab_gang_bang = 32 << 10
 183  183  };
 184  184  
 185  185  extern uint64_t metaslab_gang_bang;
 186  186  extern uint64_t metaslab_df_alloc_threshold;
 187      -extern uint64_t zfs_deadman_synctime;
      187 +extern uint64_t zfs_deadman_synctime_ms;
 188  188  
 189  189  static ztest_shared_opts_t *ztest_shared_opts;
 190  190  static ztest_shared_opts_t ztest_opts;
 191  191  
 192  192  typedef struct ztest_shared_ds {
 193  193          uint64_t        zd_seq;
 194  194  } ztest_shared_ds_t;
 195  195  
 196  196  static ztest_shared_ds_t *ztest_shared_ds;
 197  197  #define ZTEST_GET_SHARED_DS(d) (&ztest_shared_ds[d])
↓ open down ↓ 5120 lines elided ↑ open up ↑
5318 5318  }
5319 5319  
5320 5320  static void *
5321 5321  ztest_deadman_thread(void *arg)
5322 5322  {
5323 5323          ztest_shared_t *zs = arg;
5324 5324          spa_t *spa = ztest_spa;
5325 5325          hrtime_t delta, total = 0;
5326 5326  
5327 5327          for (;;) {
5328      -                delta = (zs->zs_thread_stop - zs->zs_thread_start) /
5329      -                    NANOSEC + zfs_deadman_synctime;
     5328 +                delta = zs->zs_thread_stop - zs->zs_thread_start +
     5329 +                    MSEC2NSEC(zfs_deadman_synctime_ms);
5330 5330  
5331      -                (void) poll(NULL, 0, (int)(1000 * delta));
     5331 +                (void) poll(NULL, 0, (int)NSEC2MSEC(delta));
5332 5332  
5333 5333                  /*
5334 5334                   * If the pool is suspended then fail immediately. Otherwise,
5335 5335                   * check to see if the pool is making any progress. If
5336 5336                   * vdev_deadman() discovers that there hasn't been any recent
5337 5337                   * I/Os then it will end up aborting the tests.
5338 5338                   */
5339 5339                  if (spa_suspended(spa)) {
5340 5340                          fatal(0, "aborting test after %llu seconds because "
5341 5341                              "pool has transitioned to a suspended state.",
5342      -                            zfs_deadman_synctime);
     5342 +                            zfs_deadman_synctime_ms / 1000);
5343 5343                          return (NULL);
5344 5344                  }
5345 5345                  vdev_deadman(spa->spa_root_vdev);
5346 5346  
5347      -                total += zfs_deadman_synctime;
     5347 +                total += zfs_deadman_synctime_ms/1000;
5348 5348                  (void) printf("ztest has been running for %lld seconds\n",
5349 5349                      total);
5350 5350          }
5351 5351  }
5352 5352  
5353 5353  static void
5354 5354  ztest_execute(int test, ztest_info_t *zi, uint64_t id)
5355 5355  {
5356 5356          ztest_ds_t *zd = &ztest_ds[id % ztest_opts.zo_datasets];
5357 5357          ztest_shared_callstate_t *zc = ZTEST_GET_SHARED_CALLSTATE(test);
↓ open down ↓ 708 lines elided ↑ open up ↑
6066 6066          char timebuf[100];
6067 6067          char numbuf[6];
6068 6068          spa_t *spa;
6069 6069          char *cmd;
6070 6070          boolean_t hasalt;
6071 6071          char *fd_data_str = getenv("ZTEST_FD_DATA");
6072 6072  
6073 6073          (void) setvbuf(stdout, NULL, _IOLBF, 0);
6074 6074  
6075 6075          dprintf_setup(&argc, argv);
6076      -        zfs_deadman_synctime = 300;
     6076 +        zfs_deadman_synctime_ms = 300000;
6077 6077  
6078 6078          ztest_fd_rand = open("/dev/urandom", O_RDONLY);
6079 6079          ASSERT3S(ztest_fd_rand, >=, 0);
6080 6080  
6081 6081          if (!fd_data_str) {
6082 6082                  process_options(argc, argv);
6083 6083  
6084 6084                  setup_data_fd();
6085 6085                  setup_hdr();
6086 6086                  setup_data();
↓ open down ↓ 186 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX