Deprecate verifysort and verifysort_nr
authorJens Axboe <axboe@kernel.dk>
Wed, 18 Apr 2018 03:50:55 +0000 (21:50 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Apr 2018 03:50:55 +0000 (21:50 -0600)
It was an optimization to read back verifies in a sorted order,
for rotational storage. But I don't think the option makes much
sense, and I've never heard of anyone using it. Mark it as
deprecated, and always verify in the same order that IO was
written.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
cconv.c
fio.h
io_u.c
iolog.c
options.c
rate-submit.c
thread_options.h
verify.c

index b28c3dbc4fd65fdf71b3ad4581a9b27e9aac7511..a2a0b3da61458f4e6171c868f2fb07b4b77faa38 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1549,7 +1549,6 @@ static void *thread_main(void *data)
        INIT_FLIST_HEAD(&td->io_hist_list);
        INIT_FLIST_HEAD(&td->verify_list);
        INIT_FLIST_HEAD(&td->trim_list);
        INIT_FLIST_HEAD(&td->io_hist_list);
        INIT_FLIST_HEAD(&td->verify_list);
        INIT_FLIST_HEAD(&td->trim_list);
-       INIT_FLIST_HEAD(&td->next_rand_list);
        td->io_hist_tree = RB_ROOT;
 
        ret = mutex_cond_init_pshared(&td->io_u_lock, &td->free_cond);
        td->io_hist_tree = RB_ROOT;
 
        ret = mutex_cond_init_pshared(&td->io_u_lock, &td->free_cond);
diff --git a/cconv.c b/cconv.c
index 585ed86469187a10eaf4e6d6327f4f59a0abaa5c..9e163b35fd68627e147f434adc0288e8cec926fd 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -162,8 +162,6 @@ void convert_thread_options_to_cpu(struct thread_options *o,
        o->write_hint = le32_to_cpu(top->write_hint);
        o->verify = le32_to_cpu(top->verify);
        o->do_verify = le32_to_cpu(top->do_verify);
        o->write_hint = le32_to_cpu(top->write_hint);
        o->verify = le32_to_cpu(top->verify);
        o->do_verify = le32_to_cpu(top->do_verify);
-       o->verifysort = le32_to_cpu(top->verifysort);
-       o->verifysort_nr = le32_to_cpu(top->verifysort_nr);
        o->experimental_verify = le32_to_cpu(top->experimental_verify);
        o->verify_state = le32_to_cpu(top->verify_state);
        o->verify_interval = le32_to_cpu(top->verify_interval);
        o->experimental_verify = le32_to_cpu(top->experimental_verify);
        o->verify_state = le32_to_cpu(top->verify_state);
        o->verify_interval = le32_to_cpu(top->verify_interval);
@@ -376,8 +374,6 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->write_hint = cpu_to_le32(o->write_hint);
        top->verify = cpu_to_le32(o->verify);
        top->do_verify = cpu_to_le32(o->do_verify);
        top->write_hint = cpu_to_le32(o->write_hint);
        top->verify = cpu_to_le32(o->verify);
        top->do_verify = cpu_to_le32(o->do_verify);
-       top->verifysort = cpu_to_le32(o->verifysort);
-       top->verifysort_nr = cpu_to_le32(o->verifysort_nr);
        top->experimental_verify = cpu_to_le32(o->experimental_verify);
        top->verify_state = cpu_to_le32(o->verify_state);
        top->verify_interval = cpu_to_le32(o->verify_interval);
        top->experimental_verify = cpu_to_le32(o->experimental_verify);
        top->verify_state = cpu_to_le32(o->verify_state);
        top->verify_interval = cpu_to_le32(o->verify_interval);
diff --git a/fio.h b/fio.h
index 2bfcac457c217693f1bce4aa6c855a2a67f6e014..4ce4991b57c1eb1a24b2b1304fbbc89cee84326a 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -405,8 +405,6 @@ struct thread_data {
        struct flist_head trim_list;
        unsigned long trim_entries;
 
        struct flist_head trim_list;
        unsigned long trim_entries;
 
-       struct flist_head next_rand_list;
-
        /*
         * for fileservice, how often to switch to a new file
         */
        /*
         * for fileservice, how often to switch to a new file
         */
diff --git a/io_u.c b/io_u.c
index 5fbb2386237de6ba8aa106917e9f222ae564e014..633f6175170f4c88004c71fa14e756cf55d22480 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -77,11 +77,6 @@ static uint64_t last_block(struct thread_data *td, struct fio_file *f,
        return max_blocks;
 }
 
        return max_blocks;
 }
 
-struct rand_off {
-       struct flist_head list;
-       uint64_t off;
-};
-
 static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                                  enum fio_ddir ddir, uint64_t *b,
                                  uint64_t lastb)
 static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                                  enum fio_ddir ddir, uint64_t *b,
                                  uint64_t lastb)
@@ -272,16 +267,8 @@ bail:
        return 0;
 }
 
        return 0;
 }
 
-static int flist_cmp(void *data, struct flist_head *a, struct flist_head *b)
-{
-       struct rand_off *r1 = flist_entry(a, struct rand_off, list);
-       struct rand_off *r2 = flist_entry(b, struct rand_off, list);
-
-       return r1->off - r2->off;
-}
-
-static int get_off_from_method(struct thread_data *td, struct fio_file *f,
-                              enum fio_ddir ddir, uint64_t *b)
+static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
+                               enum fio_ddir ddir, uint64_t *b)
 {
        if (td->o.random_distribution == FIO_RAND_DIST_RANDOM) {
                uint64_t lastb;
 {
        if (td->o.random_distribution == FIO_RAND_DIST_RANDOM) {
                uint64_t lastb;
@@ -306,25 +293,6 @@ static int get_off_from_method(struct thread_data *td, struct fio_file *f,
        return 1;
 }
 
        return 1;
 }
 
-/*
- * Sort the reads for a verify phase in batches of verifysort_nr, if
- * specified.
- */
-static inline bool should_sort_io(struct thread_data *td)
-{
-       if (!td->o.verifysort_nr || !td->o.do_verify)
-               return false;
-       if (!td_random(td))
-               return false;
-       if (td->runstate != TD_VERIFYING)
-               return false;
-       if (td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE ||
-           td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE64)
-               return false;
-
-       return true;
-}
-
 static bool should_do_random(struct thread_data *td, enum fio_ddir ddir)
 {
        unsigned int v;
 static bool should_do_random(struct thread_data *td, enum fio_ddir ddir)
 {
        unsigned int v;
@@ -337,44 +305,6 @@ static bool should_do_random(struct thread_data *td, enum fio_ddir ddir)
        return v <= td->o.perc_rand[ddir];
 }
 
        return v <= td->o.perc_rand[ddir];
 }
 
-static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
-                               enum fio_ddir ddir, uint64_t *b)
-{
-       struct rand_off *r;
-       int i, ret = 1;
-
-       if (!should_sort_io(td))
-               return get_off_from_method(td, f, ddir, b);
-
-       if (!flist_empty(&td->next_rand_list)) {
-fetch:
-               r = flist_first_entry(&td->next_rand_list, struct rand_off, list);
-               flist_del(&r->list);
-               *b = r->off;
-               free(r);
-               return 0;
-       }
-
-       for (i = 0; i < td->o.verifysort_nr; i++) {
-               r = malloc(sizeof(*r));
-
-               ret = get_off_from_method(td, f, ddir, &r->off);
-               if (ret) {
-                       free(r);
-                       break;
-               }
-
-               flist_add(&r->list, &td->next_rand_list);
-       }
-
-       if (ret && !i)
-               return ret;
-
-       assert(!flist_empty(&td->next_rand_list));
-       flist_sort(NULL, &td->next_rand_list, flist_cmp);
-       goto fetch;
-}
-
 static void loop_cache_invalidate(struct thread_data *td, struct fio_file *f)
 {
        struct thread_options *o = &td->o;
 static void loop_cache_invalidate(struct thread_data *td, struct fio_file *f)
 {
        struct thread_options *o = &td->o;
diff --git a/iolog.c b/iolog.c
index 3f0fc22bc049121ab7488fd81665adbeafec264b..598548d2f037ad4314254cb4b5f14f9722fb4ebf 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -235,8 +235,7 @@ void log_io_piece(struct thread_data *td, struct io_u *io_u)
         * to check for duplicate blocks and drop the old one, which we rely on
         * the rb insert/lookup for handling.
         */
         * to check for duplicate blocks and drop the old one, which we rely on
         * the rb insert/lookup for handling.
         */
-       if (((!td->o.verifysort) || !td_random(td)) &&
-             file_randommap(td, ipo->file)) {
+       if (file_randommap(td, ipo->file)) {
                INIT_FLIST_HEAD(&ipo->list);
                flist_add_tail(&ipo->list, &td->io_hist_list);
                ipo->flags |= IP_F_ONLIST;
                INIT_FLIST_HEAD(&ipo->list);
                flist_add_tail(&ipo->list, &td->io_hist_list);
                ipo->flags |= IP_F_ONLIST;
index fb28511953c79e7351eb7040c0414514f1bc7055..1b3ea04d203ac84c0a9179310182eb089518c26c 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2846,25 +2846,14 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
        {
                .name   = "verifysort",
                .lname  = "Verify sort",
        {
                .name   = "verifysort",
                .lname  = "Verify sort",
-               .type   = FIO_OPT_BOOL,
-               .off1   = offsetof(struct thread_options, verifysort),
-               .help   = "Sort written verify blocks for read back",
-               .def    = "1",
-               .parent = "verify",
-               .hide   = 1,
+               .type   = FIO_OPT_SOFT_DEPRECATED,
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_VERIFY,
        },
        {
                .name   = "verifysort_nr",
                .lname  = "Verify Sort Nr",
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_VERIFY,
        },
        {
                .name   = "verifysort_nr",
                .lname  = "Verify Sort Nr",
-               .type   = FIO_OPT_INT,
-               .off1   = offsetof(struct thread_options, verifysort_nr),
-               .help   = "Pre-load and sort verify blocks for a read workload",
-               .minval = 0,
-               .maxval = 131072,
-               .def    = "1024",
-               .parent = "verify",
+               .type   = FIO_OPT_SOFT_DEPRECATED,
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_VERIFY,
        },
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_VERIFY,
        },
index fdbece64d877ee0edd1e0f5359e2222db611483d..5c77a4e8ecb83089ad2fb6a0322aafcbcab2bc4c 100644 (file)
@@ -115,7 +115,6 @@ static int io_workqueue_init_worker_fn(struct submit_worker *sw)
        INIT_FLIST_HEAD(&td->io_hist_list);
        INIT_FLIST_HEAD(&td->verify_list);
        INIT_FLIST_HEAD(&td->trim_list);
        INIT_FLIST_HEAD(&td->io_hist_list);
        INIT_FLIST_HEAD(&td->verify_list);
        INIT_FLIST_HEAD(&td->trim_list);
-       INIT_FLIST_HEAD(&td->next_rand_list);
        td->io_hist_tree = RB_ROOT;
 
        td->o.iodepth = 1;
        td->io_hist_tree = RB_ROOT;
 
        td->o.iodepth = 1;
index 944feafaf9281d4aab6fadef94ad29d5b7dfde74..4ec570dc12c65a45dac90e531eec00cde222c013 100644 (file)
@@ -110,8 +110,6 @@ struct thread_options {
        unsigned int write_hint;
        unsigned int verify;
        unsigned int do_verify;
        unsigned int write_hint;
        unsigned int verify;
        unsigned int do_verify;
-       unsigned int verifysort;
-       unsigned int verifysort_nr;
        unsigned int verify_interval;
        unsigned int verify_offset;
        char verify_pattern[MAX_PATTERN_SIZE];
        unsigned int verify_interval;
        unsigned int verify_offset;
        char verify_pattern[MAX_PATTERN_SIZE];
@@ -391,8 +389,6 @@ struct thread_options_pack {
        uint32_t write_hint;
        uint32_t verify;
        uint32_t do_verify;
        uint32_t write_hint;
        uint32_t verify;
        uint32_t do_verify;
-       uint32_t verifysort;
-       uint32_t verifysort_nr;
        uint32_t verify_interval;
        uint32_t verify_offset;
        uint8_t verify_pattern[MAX_PATTERN_SIZE];
        uint32_t verify_interval;
        uint32_t verify_offset;
        uint8_t verify_pattern[MAX_PATTERN_SIZE];
index c5fa24110143cb46cee4a6dad1db9a7e878c6a01..40d484b5c60a6ac281a2d6da5f328be3b15e3f0a 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -919,10 +919,9 @@ int verify_io_u(struct thread_data *td, struct io_u **io_u_ptr)
                hdr = p;
 
                /*
                hdr = p;
 
                /*
-                * Make rand_seed check pass when have verifysort or
-                * verify_backlog.
+                * Make rand_seed check pass when have verify_backlog.
                 */
                 */
-               if (td->o.verifysort || (td->flags & TD_F_VER_BACKLOG))
+               if (!td_rw(td) || (td->flags & TD_F_VER_BACKLOG))
                        io_u->rand_seed = hdr->rand_seed;
 
                if (td->o.verify != VERIFY_PATTERN_NO_HDR) {
                        io_u->rand_seed = hdr->rand_seed;
 
                if (td->o.verify != VERIFY_PATTERN_NO_HDR) {