Avoid using units in option defaults
authorRobert Elliott <elliott@hpe.com>
Thu, 22 Dec 2016 20:50:40 +0000 (14:50 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 3 Jan 2017 01:19:49 +0000 (18:19 -0700)
Change option defaults and some generated option strings to specify
the number of bytes without units, so they are immune to the
interpretation of the units (e.g. is 1M interpreted as
1048576 or 1000000).

Signed-off-by: Jens Axboe <axboe@fb.com>
options.c
profiles/act.c
profiles/tiobench.c
unit_tests/steadystate_tests.py

index d8b4012f87345387fc3ac6626c28b262f27c73a0..dae84138eb827ecef4fa0e77c89894637ed2c206 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1965,7 +1965,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .off3   = offsetof(struct thread_options, bs[DDIR_TRIM]),
                .minval = 1,
                .help   = "Block size unit",
-               .def    = "4k",
+               .def    = "4096",
                .parent = "rw",
                .hide   = 1,
                .interval = 512,
index 3e9238b31bf02ea6a14a1ccf70f3ca6f7c97b22f..58ae7af9b86c6b9241c0af9099283bb0d646cd97 100644 (file)
@@ -144,7 +144,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_INT,
                .off1   = offsetof(struct act_options, write_size),
                .help   = "Size of large block ops (writes)",
-               .def    = "128k",
+               .def    = "131072",
                .category = FIO_OPT_C_PROFILE,
                .group  = FIO_OPT_G_ACT,
        },
@@ -220,7 +220,7 @@ static int act_add_dev_prep(const char *dev)
                return 1;
        if (act_add_opt("filename=%s", dev))
                return 1;
-       if (act_add_opt("bs=1M"))
+       if (act_add_opt("bs=1048576"))
                return 1;
        if (act_add_opt("zero_buffers"))
                return 1;
@@ -234,7 +234,7 @@ static int act_add_dev_prep(const char *dev)
                return 1;
        if (act_add_opt("filename=%s", dev))
                return 1;
-       if (act_add_opt("bs=4k"))
+       if (act_add_opt("bs=4096"))
                return 1;
        if (act_add_opt("ioengine=libaio"))
                return 1;
index 8af6f4edb1116984e3192c3c8c059d06d46c2826..17229b9e060c88f25f26ef70094fe3771f48c3c6 100644 (file)
@@ -49,7 +49,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_INT,
                .off1   = offsetof(struct tiobench_options, bs),
                .help   = "Block size in bytes",
-               .def    = "4k",
+               .def    = "4096",
                .category = FIO_OPT_C_PROFILE,
                .group  = FIO_OPT_G_TIOBENCH,
        },
index a8e4e39af14cd661b091cde4d1606e48e253bae7..91c79a45aa6bc67d7b0b9575231dc7691eee22ad 100755 (executable)
@@ -115,7 +115,7 @@ if __name__ == '__main__':
     if args.read == None:
         if os.name == 'posix':
             args.read = '/dev/zero'
-            extra = [ "--size=128M" ]
+            extra = [ "--size=134217728" ]  # 128 MiB
         else:
             print "ERROR: file for read testing must be specified on non-posix systems"
             sys.exit(1)