From: Jens Axboe Date: Thu, 11 Apr 2013 10:31:29 +0000 (+0200) Subject: Merge branch 'gfio' into gfio-int X-Git-Tag: fio-2.1~57 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8f91cc3f7835cdca84944d456e1da77d44a7c354;hp=8dc6ebac4b1b406969fb5698505f0c88a1b7d80b Merge branch 'gfio' into gfio-int Conflicts: backend.c fio.c fio.h init.c libfio.c options.c thread_options.h Signed-off-by: Jens Axboe --- diff --git a/README b/README index 317ddec6..8db962b6 100644 --- a/README +++ b/README @@ -224,115 +224,9 @@ complex setups with the command line, but generally it's a lot easier to just write a simple job file to describe the workload. The job file format is in the ini style format, as that is easy to read and write for the user. -The job file parameters are: - - name=x Use 'x' as the identifier for this job. - description=x 'x' is a text description of the job. - directory=x Use 'x' as the top level directory for storing files - filename=x Force the use of 'x' as the filename for all files - in this thread. If not given, fio will make up - a suitable filename based on the thread and file - number. - rw=x 'x' may be: read, randread, write, randwrite, - rw (read-write mix), randrw (read-write random mix) - rwmixcycle=x Base cycle for switching between read and write - in msecs. - rwmixread=x 'x' percentage of rw mix ios will be reads. If - rwmixwrite is also given, the last of the two will - be used if they don't add up to 100%. - rwmixwrite=x 'x' percentage of rw mix ios will be writes. See - rwmixread. - rand_repeatable=x The sequence of random io blocks can be repeatable - across runs, if 'x' is 1. - size=x Set file size to x bytes (x string can include k/m/g) - ioengine=x 'x' may be: aio/libaio/linuxaio for Linux aio, - posixaio for POSIX aio, solarisaio for Solaris - native async IO, windowsaio for Windows native async IO, - sync for regular read/write io, - psync for regular pread/pwrite io, vsync for regular - readv/writev (with queuing emulation) mmap for mmap'ed - io, syslet-rw for syslet driven read/write, splice for - using splice/vmsplice, sg for direct SG_IO io, net - for network io, rdma for RDMA io, or cpuio for a - cycler burner load. sg only works on Linux on - SCSI (or SCSI-like devices, such as usb-storage or - sata/libata driven) devices. Fio also has a null - io engine, which is mainly used for testing - fio itself. - - iodepth=x For async io, allow 'x' ios in flight - overwrite=x If 'x', layout a write file first. - nrfiles=x Spread io load over 'x' number of files per job, - if possible. - prio=x Run io at prio X, 0-7 is the kernel allowed range - prioclass=x Run io at prio class X - bs=x Use 'x' for thread blocksize. May include k/m postfix. - bsrange=x-y Mix thread block sizes randomly between x and y. May - also include k/m postfix. - direct=x 1 for direct IO, 0 for buffered IO - thinktime=x "Think" x usec after each io - rate=x Throttle rate to x KB/sec - ratemin=x Quit if rate of x KB/sec can't be met - ratecycle=x ratemin averaged over x msecs - cpumask=x Only allow job to run on CPUs defined by mask. - cpus_allowed=x Like 'cpumask', but allow text setting of CPU affinity. - numa_cpu_nodes=x,y-z Allow job to run on specified NUMA nodes' CPU. - numa_mem_policy=m:x,y-z Setup numa memory allocation policy. - 'm' stands for policy, such as local, interleave, - bind, prefer, local. 'x, y-z' are numa node(s) for - memory allocation according to policy. - fsync=x If writing with buffered IO, fsync after every - 'x' blocks have been written. - end_fsync=x If 'x', run fsync() after end-of-job. - startdelay=x Start this thread x seconds after startup - runtime=x Terminate x seconds after startup. Can include a - normal time suffix if not given in seconds, such as - 'm' for minutes, 'h' for hours, and 'd' for days. - offset=x Start io at offset x (x string can include k/m/g) - invalidate=x Invalidate page cache for file prior to doing io - sync=x Use sync writes if x and writing buffered IO. - mem=x If x == malloc, use malloc for buffers. If x == shm, - use shared memory for buffers. If x == mmap, use - anonymous mmap. - exitall When one thread quits, terminate the others - bwavgtime=x Average bandwidth stats over an x msec window. - create_serialize=x If 'x', serialize file creation. - create_fsync=x If 'x', run fsync() after file creation. - unlink If set, unlink files when done. - loops=x Run the job 'x' number of times. - verify=x If 'x' == md5, use md5 for verifies. If 'x' == crc32, - use crc32 for verifies. md5 is 'safer', but crc32 is - a lot faster. Only makes sense for writing to a file. - For other types of checksumming, see HOWTO. - stonewall Wait for preceeding jobs to end before running. - numjobs=x Create 'x' similar entries for this job - thread Use pthreads instead of forked jobs - zonesize=x - zoneskip=y Zone options must be paired. If given, the job - will skip y bytes for every x read/written. This - can be used to gauge hard drive speed over the entire - platter, without reading everything. Both x/y can - include k/m/g suffix. - read_iolog=x Open and read io pattern from file 'x'. The file format - is described in the HOWTO. - write_iolog=x Write an iolog to file 'x' in the same format as iolog. - The iolog options are exclusive, if both given the - read iolog will be performed. Specify a separate file - for each job, otherwise the iologs will be interspersed - and the file may be corrupt. - write_bw_log Write a bandwidth log. - write_lat_log Write a latency log. - lockmem=x Lock down x amount of memory on the machine, to - simulate a machine with less memory available. x can - include k/m/g suffix. - nice=x Run job at given nice value. - exec_prerun=x Run 'x' before job io is begun. - exec_postrun=x Run 'x' after job io has finished. - ioscheduler=x Use ioscheduler 'x' for this job. - cpuload=x For a CPU io thread, percentage of CPU time to attempt - to burn. - cpuchunks=x Split burn cycles into pieces of x usecs. - +The HOWTO or man page has a full list of all options, along with +descriptions, etc. The --cmdhelp option also lists all options. If +used with an option argument, it will detail that particular option. Client/server diff --git a/backend.c b/backend.c index 022122a2..119c4f98 100644 --- a/backend.c +++ b/backend.c @@ -1103,7 +1103,7 @@ static void *thread_main(void *data) } else td->pid = gettid(); - fio_local_clock_init(td->o.use_thread); + fio_local_clock_init(o->use_thread); dprint(FD_PROCESS, "jobs pid=%d started\n", (int) td->pid); @@ -1173,7 +1173,7 @@ static void *thread_main(void *data) #ifdef CONFIG_LIBNUMA /* numa node setup */ - if (td->o.numa_cpumask_set || td->o.numa_memmask_set) { + if (o->numa_cpumask_set || o->numa_memmask_set) { int ret; if (numa_available() < 0) { @@ -1181,8 +1181,8 @@ static void *thread_main(void *data) goto err; } - if (td->o.numa_cpumask_set) { - ret = numa_run_on_node_mask(td->o.numa_cpunodesmask); + if (o->numa_cpumask_set) { + ret = numa_run_on_node_mask(o->numa_cpunodesmask); if (ret == -1) { td_verror(td, errno, \ "numa_run_on_node_mask failed\n"); @@ -1190,20 +1190,20 @@ static void *thread_main(void *data) } } - if (td->o.numa_memmask_set) { + if (o->numa_memmask_set) { - switch (td->o.numa_mem_mode) { + switch (o->numa_mem_mode) { case MPOL_INTERLEAVE: - numa_set_interleave_mask(td->o.numa_memnodesmask); + numa_set_interleave_mask(o->numa_memnodesmask); break; case MPOL_BIND: - numa_set_membind(td->o.numa_memnodesmask); + numa_set_membind(o->numa_memnodesmask); break; case MPOL_LOCAL: numa_set_localalloc(); break; case MPOL_PREFERRED: - numa_set_preferred(td->o.numa_mem_prefer_node); + numa_set_preferred(o->numa_mem_prefer_node); break; case MPOL_DEFAULT: default: @@ -1214,6 +1214,9 @@ static void *thread_main(void *data) } #endif + if (fio_pin_memory(td)) + goto err; + /* * May alter parameters that init_io_u() will use, so we need to * do this first. @@ -1235,7 +1238,7 @@ static void *thread_main(void *data) } } - if (td->o.cgroup && cgroup_setup(td, cgroup_list, &cgroup_mnt)) + if (o->cgroup && cgroup_setup(td, cgroup_list, &cgroup_mnt)) goto err; errno = 0; @@ -1277,8 +1280,8 @@ static void *thread_main(void *data) memcpy(&td->iops_sample_time, &td->start, sizeof(td->start)); memcpy(&td->tv_cache, &td->start, sizeof(td->start)); - if (td->o.ratemin[DDIR_READ] || td->o.ratemin[DDIR_WRITE] || - td->o.ratemin[DDIR_TRIM]) { + if (o->ratemin[DDIR_READ] || o->ratemin[DDIR_WRITE] || + o->ratemin[DDIR_TRIM]) { memcpy(&td->lastrate[DDIR_READ], &td->bw_sample_time, sizeof(td->bw_sample_time)); memcpy(&td->lastrate[DDIR_WRITE], &td->bw_sample_time, @@ -1312,8 +1315,8 @@ static void *thread_main(void *data) if (td->error || td->terminate) break; - if (!td->o.do_verify || - td->o.verify == VERIFY_NONE || + if (!o->do_verify || + o->verify == VERIFY_NONE || (td->io_ops->flags & FIO_UNIDIR)) continue; @@ -1342,44 +1345,44 @@ static void *thread_main(void *data) fio_mutex_down(writeout_mutex); if (td->bw_log) { - if (td->o.bw_log_file) { + if (o->bw_log_file) { finish_log_named(td, td->bw_log, - td->o.bw_log_file, "bw"); + o->bw_log_file, "bw"); } else finish_log(td, td->bw_log, "bw"); } if (td->lat_log) { - if (td->o.lat_log_file) { + if (o->lat_log_file) { finish_log_named(td, td->lat_log, - td->o.lat_log_file, "lat"); + o->lat_log_file, "lat"); } else finish_log(td, td->lat_log, "lat"); } if (td->slat_log) { - if (td->o.lat_log_file) { + if (o->lat_log_file) { finish_log_named(td, td->slat_log, - td->o.lat_log_file, "slat"); + o->lat_log_file, "slat"); } else finish_log(td, td->slat_log, "slat"); } if (td->clat_log) { - if (td->o.lat_log_file) { + if (o->lat_log_file) { finish_log_named(td, td->clat_log, - td->o.lat_log_file, "clat"); + o->lat_log_file, "clat"); } else finish_log(td, td->clat_log, "clat"); } if (td->iops_log) { - if (td->o.iops_log_file) { + if (o->iops_log_file) { finish_log_named(td, td->iops_log, - td->o.iops_log_file, "iops"); + o->iops_log_file, "iops"); } else finish_log(td, td->iops_log, "iops"); } fio_mutex_up(writeout_mutex); - if (td->o.exec_postrun) - exec_string(td->o.exec_postrun); + if (o->exec_postrun) + exec_string(o->exec_postrun); if (exitall_on_terminate) fio_terminate_threads(td->groupid); @@ -1389,7 +1392,7 @@ err: log_info("fio: pid=%d, err=%d/%s\n", (int) td->pid, td->error, td->verror); - if (td->o.verify_async) + if (o->verify_async) verify_async_exit(td); close_and_free_files(td); @@ -1406,7 +1409,7 @@ err: /* * do this very late, it will log file closing as well */ - if (td->o.write_iolog_file) + if (o->write_iolog_file) write_iolog_close(td); fio_mutex_remove(td->rusage_sem); diff --git a/examples/cpuio b/examples/cpuio deleted file mode 100644 index 577e0729..00000000 --- a/examples/cpuio +++ /dev/null @@ -1,8 +0,0 @@ -[global] -ioengine=cpuio -time_based -runtime=10 - -[burn50percent] -cpuload=50 - diff --git a/examples/cpuio.fio b/examples/cpuio.fio new file mode 100644 index 00000000..577e0729 --- /dev/null +++ b/examples/cpuio.fio @@ -0,0 +1,8 @@ +[global] +ioengine=cpuio +time_based +runtime=10 + +[burn50percent] +cpuload=50 + diff --git a/examples/e4defrag b/examples/e4defrag deleted file mode 100644 index cb94e85a..00000000 --- a/examples/e4defrag +++ /dev/null @@ -1,41 +0,0 @@ -[global] -ioengine=e4defrag -directory=/scratch -nrfiles=1 -filesize=100M -size=100M -bs=32k -#group_reporting - -[isolated-e4defrag] -# It is important to disable buffered io -buffered=0 -donorname=file.def -filename=file1 -inplace=0 -rw=write - -# Run e4defrag and aio-dio workers in parallel -[e4defrag] -stonewall -time_based=30 -runtime=30 -ioengine=e4defrag -buffered=0 -donorname=file.def -filename=file1 -inplace=0 -rw=write - -[random-aio-32k] -ioengine=libaio -runtime=30 -verify=md5 -direct=1 -bs=64k -iodepth=128 -filename=file1 -rw=randrw -numjobs=4 - - diff --git a/examples/e4defrag.fio b/examples/e4defrag.fio new file mode 100644 index 00000000..cb94e85a --- /dev/null +++ b/examples/e4defrag.fio @@ -0,0 +1,41 @@ +[global] +ioengine=e4defrag +directory=/scratch +nrfiles=1 +filesize=100M +size=100M +bs=32k +#group_reporting + +[isolated-e4defrag] +# It is important to disable buffered io +buffered=0 +donorname=file.def +filename=file1 +inplace=0 +rw=write + +# Run e4defrag and aio-dio workers in parallel +[e4defrag] +stonewall +time_based=30 +runtime=30 +ioengine=e4defrag +buffered=0 +donorname=file.def +filename=file1 +inplace=0 +rw=write + +[random-aio-32k] +ioengine=libaio +runtime=30 +verify=md5 +direct=1 +bs=64k +iodepth=128 +filename=file1 +rw=randrw +numjobs=4 + + diff --git a/examples/e4defrag2 b/examples/e4defrag2 deleted file mode 100644 index 818618af..00000000 --- a/examples/e4defrag2 +++ /dev/null @@ -1,88 +0,0 @@ -################################################# -# Hardcode defragmentation patterns -# Please be carefull, it can trigger kernel panic -################################################# -[global] -ioengine=e4defrag -group_reporting -directory=/scratch -nrfiles=1 -filesize=100M -size=100M -donorname=file.def -bs=32k - -########### -# Run several defragmentation threads for different files, but -# use shared donor file -[parallel-e4defrag] -buffered=0 -inplace=0 -rw=write -numjobs=4 - -######## -# Run two defragmentation threads, each thread use another's file -# as donor file - -[e4defrag-1] -stonewall -inplace=0 -rw=write -donorname=e4defrag-2 - -[e4defrag-2] -inplace=0 -rw=write -donorname=e4defrag-1 - -########### -# Run random defragment activity -[e4defrag-fuzzer-4k] -stonewall -inplace=1 -bs=4k -rw=randwrite -filename=file -donorname=file.def - -######## -# Run random e4defrag and various aio workers in parallel -[e4defrag-fuzzer-4k] -stonewall -continue_on_error=all -inplace=1 -bs=4k -donorname=file3.def -filename=file3 -time_based=30 -rw=randwrite - -[buffered-aio-32k] -continue_on_error=none -verify=md5 -buffered=1 -ioengine=libaio -iodepth=128 -bs=32k -filename=file3 -rw=randrw -runtime=30 -time_based=30 -numjobs=4 - -[direct-aio-32k] -continue_on_error=none -verify=md5 -buffered=0 -direct=1 -ioengine=libaio -iodepth=128 -bs=32k -filename=file3 -rw=randrw -runtime=30 -time_based=30 -numjobs=4 - - diff --git a/examples/e4defrag2.fio b/examples/e4defrag2.fio new file mode 100644 index 00000000..818618af --- /dev/null +++ b/examples/e4defrag2.fio @@ -0,0 +1,88 @@ +################################################# +# Hardcode defragmentation patterns +# Please be carefull, it can trigger kernel panic +################################################# +[global] +ioengine=e4defrag +group_reporting +directory=/scratch +nrfiles=1 +filesize=100M +size=100M +donorname=file.def +bs=32k + +########### +# Run several defragmentation threads for different files, but +# use shared donor file +[parallel-e4defrag] +buffered=0 +inplace=0 +rw=write +numjobs=4 + +######## +# Run two defragmentation threads, each thread use another's file +# as donor file + +[e4defrag-1] +stonewall +inplace=0 +rw=write +donorname=e4defrag-2 + +[e4defrag-2] +inplace=0 +rw=write +donorname=e4defrag-1 + +########### +# Run random defragment activity +[e4defrag-fuzzer-4k] +stonewall +inplace=1 +bs=4k +rw=randwrite +filename=file +donorname=file.def + +######## +# Run random e4defrag and various aio workers in parallel +[e4defrag-fuzzer-4k] +stonewall +continue_on_error=all +inplace=1 +bs=4k +donorname=file3.def +filename=file3 +time_based=30 +rw=randwrite + +[buffered-aio-32k] +continue_on_error=none +verify=md5 +buffered=1 +ioengine=libaio +iodepth=128 +bs=32k +filename=file3 +rw=randrw +runtime=30 +time_based=30 +numjobs=4 + +[direct-aio-32k] +continue_on_error=none +verify=md5 +buffered=0 +direct=1 +ioengine=libaio +iodepth=128 +bs=32k +filename=file3 +rw=randrw +runtime=30 +time_based=30 +numjobs=4 + + diff --git a/examples/enospc-pressure b/examples/enospc-pressure deleted file mode 100644 index ca9d8f7a..00000000 --- a/examples/enospc-pressure +++ /dev/null @@ -1,51 +0,0 @@ -# -# Test for race-condition DIO-write vs punch_hole -# If race exist dio may rewrite punched block after -# it was allocated to another file, we will catch that -# by verifying blocks content -# -[global] -ioengine=libaio -directory=/scratch -# File size is reasonably huge to provoke ENOSPC -filesize=128G -size=999G -iodepth=128 - -# Expect write failure due to ENOSPC, skip error dump -continue_on_error=write -ignore_error=,ENOSPC -error_dump=0 -fallocate=none -exitall - -# Two threads (dio and punch_hole) operate on single file:'raicer', -# We do not care about data content here -[dio-raicer] -bs=128k -direct=1 -buffered=0 -rw=randwrite -runtime=100 -filename=raicer -time_based - -[punch_hole-raicer] -bs=4k -rw=randtrim -filename=raicer - -# Verifier thread continiously write to newly allcated blocks -# and veryfy written content -[aio-dio-verifier] -create_on_open=1 -verify=crc32c-intel -verify_fatal=1 -verify_dump=1 -verify_backlog=1024 -verify_async=4 -direct=1 -# block size should be equals to fs block size to prevent short writes -bs=4k -rw=randrw -filename=aio-dio-verifier diff --git a/examples/enospc-pressure.fio b/examples/enospc-pressure.fio new file mode 100644 index 00000000..ca9d8f7a --- /dev/null +++ b/examples/enospc-pressure.fio @@ -0,0 +1,51 @@ +# +# Test for race-condition DIO-write vs punch_hole +# If race exist dio may rewrite punched block after +# it was allocated to another file, we will catch that +# by verifying blocks content +# +[global] +ioengine=libaio +directory=/scratch +# File size is reasonably huge to provoke ENOSPC +filesize=128G +size=999G +iodepth=128 + +# Expect write failure due to ENOSPC, skip error dump +continue_on_error=write +ignore_error=,ENOSPC +error_dump=0 +fallocate=none +exitall + +# Two threads (dio and punch_hole) operate on single file:'raicer', +# We do not care about data content here +[dio-raicer] +bs=128k +direct=1 +buffered=0 +rw=randwrite +runtime=100 +filename=raicer +time_based + +[punch_hole-raicer] +bs=4k +rw=randtrim +filename=raicer + +# Verifier thread continiously write to newly allcated blocks +# and veryfy written content +[aio-dio-verifier] +create_on_open=1 +verify=crc32c-intel +verify_fatal=1 +verify_dump=1 +verify_backlog=1024 +verify_async=4 +direct=1 +# block size should be equals to fs block size to prevent short writes +bs=4k +rw=randrw +filename=aio-dio-verifier diff --git a/examples/falloc b/examples/falloc deleted file mode 100644 index fa307314..00000000 --- a/examples/falloc +++ /dev/null @@ -1,54 +0,0 @@ -[global] -ioengine=falloc -iodepth=1 -direct=0 -buffered=0 -directory=/scratch -nrfiles=1 -size=100M -filesize=100M -group_reporting - - -# Run falloc and punch_hole threads in parallel -# After activity file will be highly fragmented -[falloc-fuzzer] -stonewall -runtime=10 -time_based=10 -bssplit=4k/10:64k/50:32k/40 -rw=randwrite -numjobs=1 -filename=fragmented_file - -[punch hole-fuzzer] -bs=4k -runtime=10 -time_based=10 -rw=randtrim -numjobs=2 -filename=fragmented_file - -## Mesure IO performance on fragmented file -[sequential aio-dio write] -stonewall -ioengine=libaio -numjobs=1 -iodepth=128 -buffered=0 -direct=1 -rw=write -bs=64k -filename=fragmented_file - -[sequential buffered read] -stonewall -ioengine=sync -numjobs=1 -iodepth=1 -buffered=1 -direct=0 -rw=read -bs=64k -filename=fragmented_file - diff --git a/examples/falloc.fio b/examples/falloc.fio new file mode 100644 index 00000000..fa307314 --- /dev/null +++ b/examples/falloc.fio @@ -0,0 +1,54 @@ +[global] +ioengine=falloc +iodepth=1 +direct=0 +buffered=0 +directory=/scratch +nrfiles=1 +size=100M +filesize=100M +group_reporting + + +# Run falloc and punch_hole threads in parallel +# After activity file will be highly fragmented +[falloc-fuzzer] +stonewall +runtime=10 +time_based=10 +bssplit=4k/10:64k/50:32k/40 +rw=randwrite +numjobs=1 +filename=fragmented_file + +[punch hole-fuzzer] +bs=4k +runtime=10 +time_based=10 +rw=randtrim +numjobs=2 +filename=fragmented_file + +## Mesure IO performance on fragmented file +[sequential aio-dio write] +stonewall +ioengine=libaio +numjobs=1 +iodepth=128 +buffered=0 +direct=1 +rw=write +bs=64k +filename=fragmented_file + +[sequential buffered read] +stonewall +ioengine=sync +numjobs=1 +iodepth=1 +buffered=1 +direct=0 +rw=read +bs=64k +filename=fragmented_file + diff --git a/examples/fusion-aw-sync.fio b/examples/fusion-aw-sync.fio new file mode 100644 index 00000000..c4639f06 --- /dev/null +++ b/examples/fusion-aw-sync.fio @@ -0,0 +1,15 @@ +# Example Job File that randomly writes 8k worth of data atomically for +# 60 seconds. +[rw_aw_file_sync] +rw=randwrite +ioengine=fusion-aw-sync +blocksize=8k +blockalign=8k + +filename=/mnt/fs/file +randrepeat=1 +fallocate=none +direct=1 +invalidate=0 +runtime=60 +time_based diff --git a/examples/fusion-aw-sync.ini b/examples/fusion-aw-sync.ini deleted file mode 100644 index c4639f06..00000000 --- a/examples/fusion-aw-sync.ini +++ /dev/null @@ -1,15 +0,0 @@ -# Example Job File that randomly writes 8k worth of data atomically for -# 60 seconds. -[rw_aw_file_sync] -rw=randwrite -ioengine=fusion-aw-sync -blocksize=8k -blockalign=8k - -filename=/mnt/fs/file -randrepeat=1 -fallocate=none -direct=1 -invalidate=0 -runtime=60 -time_based diff --git a/examples/numa b/examples/numa deleted file mode 100644 index b81964f1..00000000 --- a/examples/numa +++ /dev/null @@ -1,21 +0,0 @@ -; setup numa policy for each thread -; 'numactl --show' to determine the maximum numa nodes -[global] -ioengine=libaio -buffered=0 -rw=randread -bs=512K -iodepth=16 -size=512m -filename=/dev/sdb1 - -; Fix memory blocks (512K * 16) in numa node 0 -[job1] -numa_cpu_nodes=0 -numa_mem_policy=bind:0 - -; Interleave memory blocks (512K * 16) in numa node 0 and 1 -[job2] -numa_cpu_nodes=0-1 -numa_mem_policy=interleave:0-1 - diff --git a/examples/numa.fio b/examples/numa.fio new file mode 100644 index 00000000..b81964f1 --- /dev/null +++ b/examples/numa.fio @@ -0,0 +1,21 @@ +; setup numa policy for each thread +; 'numactl --show' to determine the maximum numa nodes +[global] +ioengine=libaio +buffered=0 +rw=randread +bs=512K +iodepth=16 +size=512m +filename=/dev/sdb1 + +; Fix memory blocks (512K * 16) in numa node 0 +[job1] +numa_cpu_nodes=0 +numa_mem_policy=bind:0 + +; Interleave memory blocks (512K * 16) in numa node 0 and 1 +[job2] +numa_cpu_nodes=0-1 +numa_mem_policy=interleave:0-1 + diff --git a/examples/zipf b/examples/zipf deleted file mode 100644 index fcfa38d9..00000000 --- a/examples/zipf +++ /dev/null @@ -1,10 +0,0 @@ -# Example job file for using a zipf distribution instead -# of a purely random workload where each block is read -# or written once. -[job] -ioengine=null -rw=randread -norandommap -size=1280m -bs=4k -random_distribution=zipf:0.5 diff --git a/examples/zipf.fio b/examples/zipf.fio new file mode 100644 index 00000000..fcfa38d9 --- /dev/null +++ b/examples/zipf.fio @@ -0,0 +1,10 @@ +# Example job file for using a zipf distribution instead +# of a purely random workload where each block is read +# or written once. +[job] +ioengine=null +rw=randread +norandommap +size=1280m +bs=4k +random_distribution=zipf:0.5 diff --git a/fio.h b/fio.h index c8c8b7ab..7d478a33 100644 --- a/fio.h +++ b/fio.h @@ -20,7 +20,6 @@ struct thread_data; #include "thread_options.h" #include "flist.h" #include "fifo.h" -#include "lib/rbtree.h" #include "arch/arch.h" #include "os/os.h" #include "mutex.h" @@ -37,6 +36,7 @@ struct thread_data; #include "gettime.h" #include "lib/getopt.h" #include "lib/rand.h" +#include "lib/rbtree.h" #include "client.h" #include "server.h" #include "stat.h" @@ -445,8 +445,8 @@ extern void add_job_opts(const char **, int); extern char *num2str(unsigned long, int, int, int, int); extern int ioengine_load(struct thread_data *); -extern unsigned long page_mask; -extern unsigned long page_size; +extern uintptr_t page_mask; +extern uintptr_t page_size; extern int initialize_fio(char *envp[]); #define FIO_GETOPT_JOB 0x89000000 diff --git a/libfio.c b/libfio.c index 867d86e3..c26d6a3a 100644 --- a/libfio.c +++ b/libfio.c @@ -41,8 +41,8 @@ FLIST_HEAD(disk_list); unsigned long arch_flags = 0; -uintptr_t page_mask; -uintptr_t page_size; +uintptr_t page_mask = 0; +uintptr_t page_size = 0; static const char *fio_os_strings[os_nr] = { "Invalid", @@ -241,6 +241,10 @@ int initialize_fio(char *envp[]) return 1; } +#if !defined(CONFIG_GETTIMEOFDAY) && !defined(CONFIG_CLOCK_GETTIME) +#error "No available clock source!" +#endif + arch_init(envp); sinit(); diff --git a/thread_options.h b/thread_options.h index 68056dfb..60a1b691 100644 --- a/thread_options.h +++ b/thread_options.h @@ -5,6 +5,7 @@ #include "os/os.h" #include "stat.h" #include "gettime.h" +#include "lib/ieee754.h" /* * What type of allocation to use for io buffers