From 2b9136a34158e891091488bbf5799558c2534639 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Thu, 22 Dec 2016 14:50:40 -0600 Subject: [PATCH] Avoid using units in option defaults 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 --- options.c | 2 +- profiles/act.c | 6 +++--- profiles/tiobench.c | 2 +- unit_tests/steadystate_tests.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/options.c b/options.c index d8b4012f..dae84138 100644 --- 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, diff --git a/profiles/act.c b/profiles/act.c index 3e9238b3..58ae7af9 100644 --- a/profiles/act.c +++ b/profiles/act.c @@ -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; diff --git a/profiles/tiobench.c b/profiles/tiobench.c index 8af6f4ed..17229b9e 100644 --- a/profiles/tiobench.c +++ b/profiles/tiobench.c @@ -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, }, diff --git a/unit_tests/steadystate_tests.py b/unit_tests/steadystate_tests.py index a8e4e39a..91c79a45 100755 --- a/unit_tests/steadystate_tests.py +++ b/unit_tests/steadystate_tests.py @@ -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) -- 2.25.1