fio.git
11 years agobackend: merge in td->o to o-> thread_main() change
Jens Axboe [Thu, 11 Apr 2013 10:01:48 +0000 (12:01 +0200)]
backend: merge in td->o to o-> thread_main() change

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoRename job files
Jens Axboe [Thu, 11 Apr 2013 09:54:08 +0000 (11:54 +0200)]
Rename job files

gfio uses a .fio or .ini ending.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMove init code to libfio
Jens Axboe [Thu, 11 Apr 2013 09:51:35 +0000 (11:51 +0200)]
Move init code to libfio

More merge from gfio.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoioengine: import whitespace changes
Jens Axboe [Thu, 11 Apr 2013 06:53:24 +0000 (08:53 +0200)]
ioengine: import whitespace changes

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMake lockmem a per job option
Jens Axboe [Wed, 28 Mar 2012 18:50:15 +0000 (20:50 +0200)]
Make lockmem a per job option

We need to get rid of per job options that fiddle with global
state. It's confusing, and it breaks remote option handling.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Conflicts:
backend.c
fio.h
init.c
options.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge in crc32c-intel probe
Jens Axboe [Wed, 10 Apr 2013 20:23:40 +0000 (22:23 +0200)]
Merge in crc32c-intel probe

Then we can kill the option callback.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge in zipf differences from gfio
Jens Axboe [Wed, 10 Apr 2013 20:19:46 +0000 (22:19 +0200)]
Merge in zipf differences from gfio

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge missing content to man page
Jens Axboe [Wed, 10 Apr 2013 20:16:01 +0000 (22:16 +0200)]
Merge missing content to man page

We missed the two CPU engine private options.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoREADME: remove partial option list
Jens Axboe [Wed, 10 Apr 2013 20:13:30 +0000 (22:13 +0200)]
README: remove partial option list

The HOWTO or man page should be used, since either of those
has the full list of option keywords.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMove rbtree to lib/
Jens Axboe [Wed, 10 Apr 2013 18:48:31 +0000 (20:48 +0200)]
Move rbtree to lib/

That's where it was moved in gfio, one further step towards unifying
the branches.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Wed, 10 Apr 2013 17:50:32 +0000 (19:50 +0200)]
Merge branch 'master' into gfio

Conflicts:
engines/libaio.c
engines/net.c
iolog.h
options.c
options.h
parse.c
parse.h
thread_options.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agotiobench: remove duplicate profile group
Jens Axboe [Wed, 10 Apr 2013 17:45:30 +0000 (19:45 +0200)]
tiobench: remove duplicate profile group

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoCategorize engine and profile options
Jens Axboe [Wed, 10 Apr 2013 17:43:59 +0000 (19:43 +0200)]
Categorize engine and profile options

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: fix spelling error
Jens Axboe [Wed, 10 Apr 2013 17:35:25 +0000 (19:35 +0200)]
parse: fix spelling error

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: bring in more stuff from gfio
Jens Axboe [Wed, 10 Apr 2013 17:32:20 +0000 (19:32 +0200)]
parse: bring in more stuff from gfio

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUnify options with gfio
Jens Axboe [Wed, 10 Apr 2013 17:30:50 +0000 (19:30 +0200)]
Unify options with gfio

Add the parser features and unify the option table.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd thread_options.h
Jens Axboe [Wed, 10 Apr 2013 13:01:42 +0000 (15:01 +0200)]
Add thread_options.h

The options are always problematic to merge between the master
repo and gfio. So import this bit from gfio.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: gfio wording
Jens Axboe [Wed, 10 Apr 2013 12:41:08 +0000 (14:41 +0200)]
configure: gfio wording

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd group/category to numa/mem node options
Jens Axboe [Wed, 10 Apr 2013 11:08:02 +0000 (13:08 +0200)]
Add group/category to numa/mem node options

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: set invalid group on option with no group set
Jens Axboe [Wed, 10 Apr 2013 11:07:43 +0000 (13:07 +0200)]
parse: set invalid group on option with no group set

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: catch all options without a group/category set
Jens Axboe [Wed, 10 Apr 2013 11:05:23 +0000 (13:05 +0200)]
parse: catch all options without a group/category set

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogfio: add option group/category to filename_format
Jens Axboe [Wed, 10 Apr 2013 11:01:30 +0000 (13:01 +0200)]
gfio: add option group/category to filename_format

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: don't print min/max option ranges if posval[] is set
Jens Axboe [Wed, 10 Apr 2013 09:21:33 +0000 (11:21 +0200)]
parse: don't print min/max option ranges if posval[] is set

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Wed, 10 Apr 2013 09:12:21 +0000 (11:12 +0200)]
Merge branch 'master' into gfio

Conflicts:
options.c
parse.c
server.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoConvert unit_base to posval[]
Jens Axboe [Wed, 10 Apr 2013 09:06:59 +0000 (11:06 +0200)]
Convert unit_base to posval[]

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: for option with posval, dump allowed values on failure
Jens Axboe [Wed, 10 Apr 2013 09:06:34 +0000 (11:06 +0200)]
parse: for option with posval, dump allowed values on failure

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agooptions: make unit_base be posval[] based
Jens Axboe [Tue, 9 Apr 2013 19:05:14 +0000 (21:05 +0200)]
options: make unit_base be posval[] based

We can kill the verifier and ensure we only get the
possible values we need.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: add posval support to FIO_OPT_INT
Jens Axboe [Tue, 9 Apr 2013 19:02:15 +0000 (21:02 +0200)]
parse: add posval support to FIO_OPT_INT

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: add posval support to FIO_OPT_INT
Jens Axboe [Tue, 9 Apr 2013 19:02:15 +0000 (21:02 +0200)]
parse: add posval support to FIO_OPT_INT

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agooptions: make unit_base be posval[] based
Jens Axboe [Tue, 9 Apr 2013 18:49:45 +0000 (20:49 +0200)]
options: make unit_base be posval[] based

We can kill the verifier and ensure we only get the
possible values we need.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogfio: add support for FIO_OPT_INT options with posval
Jens Axboe [Tue, 9 Apr 2013 18:49:34 +0000 (20:49 +0200)]
gfio: add support for FIO_OPT_INT options with posval

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogfio: update new options for gfio opt format
Jens Axboe [Tue, 9 Apr 2013 18:38:32 +0000 (20:38 +0200)]
gfio: update new options for gfio opt format

And fix gclient.c updates for num2str().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoserver: bump protocol version
Jens Axboe [Tue, 9 Apr 2013 18:30:04 +0000 (20:30 +0200)]
server: bump protocol version

Commit ad705bcb adds member to protocol structures, bump it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoserver: bump protocol version
Jens Axboe [Tue, 9 Apr 2013 18:29:29 +0000 (20:29 +0200)]
server: bump protocol version

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Tue, 9 Apr 2013 18:29:16 +0000 (20:29 +0200)]
Merge branch 'master' into gfio

Conflicts:
eta.c
fio.h
init.c
options.c
stat.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agostat.c: make 'bw' summary line respect 'unit_base' option
Steven Noonan [Mon, 8 Apr 2013 22:40:13 +0000 (15:40 -0700)]
stat.c: make 'bw' summary line respect 'unit_base' option

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agostats: show summary bandwidth in terms of kb_base
Steven Noonan [Mon, 8 Apr 2013 22:25:54 +0000 (15:25 -0700)]
stats: show summary bandwidth in terms of kb_base

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoimplement 'unit_base' option to select between KB and Kbit et. al.
Steven Noonan [Mon, 8 Apr 2013 22:05:25 +0000 (15:05 -0700)]
implement 'unit_base' option to select between KB and Kbit et. al.

With network testing, it's often desirable to measure in terms of
kilobits/megabits rather than kilobytes/megabytes. This adds an option named
'unit_base' which can be set to either '1' or '8', where '1' means represent in
terms of bits and '8' means to represent rate in terms of bytes.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agonum2str: add arguments to represent values in terms of bytes/bits
Steven Noonan [Fri, 5 Apr 2013 23:57:38 +0000 (16:57 -0700)]
num2str: add arguments to represent values in terms of bytes/bits

This allows for representing I/O rates in terms of e.g. megabits (Mb) versus
megabytes (MB).

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'next'
Jens Axboe [Mon, 8 Apr 2013 07:46:54 +0000 (09:46 +0200)]
Merge branch 'next'

11 years agoFio 2.0.15 fio-2.0.15
Jens Axboe [Mon, 8 Apr 2013 07:44:38 +0000 (09:44 +0200)]
Fio 2.0.15

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMakefile: use ginstall on Solaris
Jens Axboe [Fri, 5 Apr 2013 20:13:42 +0000 (22:13 +0200)]
Makefile: use ginstall on Solaris

Regular install just doesn't seem to like man pages?!

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMakefile: use ginstall on Solaris
Jens Axboe [Fri, 5 Apr 2013 20:13:42 +0000 (22:13 +0200)]
Makefile: use ginstall on Solaris

Regular install just doesn't seem to like man pages?!

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMan page formatting fixups
Jens Axboe [Fri, 5 Apr 2013 14:32:33 +0000 (16:32 +0200)]
Man page formatting fixups

- Fix extra .B in the filename_format section
- Fix missing .RE for lockfile

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUse strcasestr() for matching filename_prefix keywords
Jens Axboe [Fri, 5 Apr 2013 12:44:51 +0000 (14:44 +0200)]
Use strcasestr() for matching filename_prefix keywords

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd strcasestr()
Jens Axboe [Fri, 5 Apr 2013 12:44:03 +0000 (14:44 +0200)]
Add strcasestr()

We'll need it for the next commit, if the platform does not
provide it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: check for zlib
Jens Axboe [Fri, 5 Apr 2013 10:55:42 +0000 (12:55 +0200)]
configure: check for zlib

It's required for gfio, even if gfio isn't enabled. The client
and server uses compression for larger messages.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix merge error
Jens Axboe [Fri, 5 Apr 2013 10:54:03 +0000 (12:54 +0200)]
Fix merge error

Fails link because we attempt to link in fio.o twice.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Fri, 5 Apr 2013 10:46:54 +0000 (12:46 +0200)]
Merge branch 'master' into gfio

Conflicts:
Makefile

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd filename_format option
Jens Axboe [Fri, 5 Apr 2013 09:09:20 +0000 (11:09 +0200)]
Add filename_format option

Allows the user to set how fio should generate the file names
used by jobs. The default is $jobname.$jobnumber.$filenumber
as it always has been, but now it's configurable as well. See
the included documentation.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogitignore: ignore configure script outputs
Steven Noonan [Thu, 4 Apr 2013 07:05:56 +0000 (09:05 +0200)]
gitignore: ignore configure script outputs

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFixup json bandwidth output
Shaohua Li [Wed, 3 Apr 2013 06:40:17 +0000 (08:40 +0200)]
Fixup json bandwidth output

The final version sent in for inclusion had the check mixed
up, so it doesn't output bandwidth unless the calculation
failed.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoparse: fix misparse of bs=64k-128k
Jens Axboe [Fri, 29 Mar 2013 18:20:51 +0000 (12:20 -0600)]
parse: fix misparse of bs=64k-128k

We failed parsing the postfix for this case, resulting in
64 and 128k being the result (instead of 64k and 128k).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: get rid of old debug ->fail_ok checking
Jens Axboe [Fri, 29 Mar 2013 18:08:40 +0000 (12:08 -0600)]
axmap: get rid of old debug ->fail_ok checking

Don't assert() on not being able to set a bit. We are returning
the number of bits we set anyway, so just have it return 0.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoWorkaround pthreads-win32 pthread_rwlock_init limitation.
Bruce Cran [Fri, 29 Mar 2013 16:17:25 +0000 (16:17 +0000)]
Workaround pthreads-win32 pthread_rwlock_init limitation.

On Windows, pthreads-win32 returns EINVAL if you specify an attribute when
calling pthread_rwlock_init. Work around this by only specifying the attribute
when FIO_HAVE_PSHARED_MUTEX is defined.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix rwlock error messages to specify the correct function names.
Bruce Cran [Fri, 29 Mar 2013 16:02:53 +0000 (16:02 +0000)]
Fix rwlock error messages to specify the correct function names.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agot/axmap: add test for multi bit sets
Jens Axboe [Fri, 29 Mar 2013 15:14:23 +0000 (09:14 -0600)]
t/axmap: add test for multi bit sets

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: fix bug with max_bs/min_bs ratio being > 64
Jens Axboe [Fri, 29 Mar 2013 14:56:09 +0000 (08:56 -0600)]
axmap: fix bug with max_bs/min_bs ratio being > 64

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: fixup build so that it's more resilient
Jens Axboe [Fri, 29 Mar 2013 14:55:32 +0000 (08:55 -0600)]
configure: fixup build so that it's more resilient

Allow people to clear/set EXTFLAGS/OPTFLAGS at will.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix usr/sys/ctx/majf/minf for -USR1 usage
Jens Axboe [Thu, 28 Mar 2013 21:08:49 +0000 (15:08 -0600)]
Fix usr/sys/ctx/majf/minf for -USR1 usage

Let the threads themselves update their stats.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix build if just one of libverbs or librdma is installed
Jens Axboe [Thu, 28 Mar 2013 18:52:17 +0000 (12:52 -0600)]
Fix build if just one of libverbs or librdma is installed

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agomutex: set pshared attributes on rw semaphore
Shaohua Li [Thu, 28 Mar 2013 14:28:51 +0000 (08:28 -0600)]
mutex: set pshared attributes on rw semaphore

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: check for v2 of libnuma
Jens Axboe [Mon, 25 Mar 2013 19:20:08 +0000 (13:20 -0600)]
configure: check for v2 of libnuma

We use options that require 2.x.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoConsider the maximum block size difference the minimum for loop exit
Jens Axboe [Sat, 23 Mar 2013 04:56:55 +0000 (22:56 -0600)]
Consider the maximum block size difference the minimum for loop exit

For mixed block sizes, we can hit the condition where we decided
to stop even if we could have done a small block size. Don't do
another loop for those cases.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoposixaio: restart suspend list after we have used aio_suspend()
Jens Axboe [Fri, 22 Mar 2013 21:23:20 +0000 (15:23 -0600)]
posixaio: restart suspend list after we have used aio_suspend()

Otherwise we could both end up putting entries in there twice,
if there are still in flight, or having done entries in there too.
So restart the suspend list after aio_suspend(), so we only put
truly still-pending ios in there.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agomutex: fix the expression for checking the mutext magic
Jianpeng Ma [Fri, 22 Mar 2013 13:16:32 +0000 (07:16 -0600)]
mutex: fix the expression for checking the mutext magic

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoOnly attempt file unlock if we use locking
Jens Axboe [Thu, 21 Mar 2013 16:06:58 +0000 (10:06 -0600)]
Only attempt file unlock if we use locking

Fixes a segfault on exit, if file locking isn't used.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agomutex: add magic checks
Jens Axboe [Thu, 21 Mar 2013 16:05:07 +0000 (10:05 -0600)]
mutex: add magic checks

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Thu, 21 Mar 2013 12:45:27 +0000 (06:45 -0600)]
Merge branch 'master' into gfio

Conflicts:
Makefile
fio.h
options.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoKill now unused lockfile_batch variable
Jens Axboe [Thu, 21 Mar 2013 12:23:14 +0000 (06:23 -0600)]
Kill now unused lockfile_batch variable

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoRework lockfile= file lock handling
Jens Axboe [Thu, 21 Mar 2013 01:57:01 +0000 (19:57 -0600)]
Rework lockfile= file lock handling

Get rid of the hand rolled rw semaphores, just use pthread
rwlocks instead. Kill the batching too, it was broken by
default, so nobody could have been using it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolib/getopt_long: clear 'optarg' every time
Jens Axboe [Tue, 19 Mar 2013 16:47:15 +0000 (10:47 -0600)]
lib/getopt_long: clear 'optarg' every time

We don't want a stale optarg argument to be available.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix re-run issue when job size is set to "unknown"
Jens Axboe [Tue, 19 Mar 2013 13:49:35 +0000 (07:49 -0600)]
Fix re-run issue when job size is set to "unknown"

Assert that td->o.size is valid before comparing the IO amount
we did to it. This prevents re-running a job because we think
there's more work to do. But if we haven't set ->o.size to a
valid value, then that must not determine whether to re-run
the loop or not.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoA few ULL -> uint64_t conversions
Jens Axboe [Tue, 19 Mar 2013 13:48:46 +0000 (07:48 -0600)]
A few ULL -> uint64_t conversions

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFixup commit error in 56c796
Jens Axboe [Mon, 18 Mar 2013 21:34:41 +0000 (15:34 -0600)]
Fixup commit error in 56c796

I hand-fondled it, forgot to revert.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAndroid: remove static Android configuration
Aaron Carroll [Thu, 14 Mar 2013 05:57:41 +0000 (16:57 +1100)]
Android: remove static Android configuration

Android can now be configured dynamically, so remove the static config.
For this we need to modify the socklen_t check #includes which appear to
be wrong anyway.

Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: endianness check for cross compile
Aaron Carroll [Thu, 14 Mar 2013 05:57:40 +0000 (16:57 +1100)]
configure: endianness check for cross compile

 - Add a cross compile check: assume yes if we can't run a test binary
 - If cross compiling, revert to a compile-time endianess check. This tries
   a few possible ways to detect big endian, but otherwise assumes little. We
   rely on the run-time check to save us if the build-time check is wrong.

Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: compile-time word size detection
Aaron Carroll [Thu, 14 Mar 2013 05:57:39 +0000 (16:57 +1100)]
configure: compile-time word size detection

Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoPropagate target OS from configure to Makefile
Aaron Carroll [Thu, 14 Mar 2013 05:57:38 +0000 (16:57 +1100)]
Propagate target OS from configure to Makefile

Propagate target OS from configure to Makefile (CONFIG_TARGET_OS) to avoid
duplicating the check in Makefile.  Also allow CROSS_COMPILE for the toolchain
prefix, which is common (e.g. Linux).

Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoandroid: fix compile by not defining FIO_NO_HAVE_SHM_H twice
Aaron Carroll [Wed, 13 Mar 2013 09:09:10 +0000 (10:09 +0100)]
android: fix compile by not defining FIO_NO_HAVE_SHM_H twice

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMake test for gnuplot work with empty strings.
Martin Steigerwald [Mon, 11 Mar 2013 15:22:56 +0000 (16:22 +0100)]
Make test for gnuplot work with empty strings.

When I launch fio_generate_plots on a system where gnuplot is not installed I
get this error :

$ fio_generate_plots test
Making bw logs
/usr/bin/fio_generate_plots: 42: /usr/bin/fio_generate_plots: -: not found

That's because the test checking whether gnuplot is installed is failing
because of an empty variable :
GNUPLOT=$(which gnuplot)
if [ ! -x $GNUPLOT ]; then
        echo You need gnuplot installed to generate graphs
        exit 1
fi

Indeed the command "test -x" is exiting with code 0.

To correct this we should enclose the variable with quotes :
if [ ! -x "$GNUPLOT" ]; then

Then the script is going into the test properly :
$ fio_generate_plots test
You need gnuplot installed to generate graphs

I copied problem description by Hervé from the Debian bug report below.

Fixes:
Bug#700580: /usr/bin/fio_generate_plots: -: not found
http://bugs.debian.org/700580

Reported-By: Hervé Werner <hwerner@score-md.com>
Tested-By: Hervé Werner <hwerner@score-md.com>
Tested-By: Martin Steigerwald <ms@teamix.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAndroid: add ioprio support
Aaron Carroll [Tue, 12 Mar 2013 04:46:10 +0000 (15:46 +1100)]
Android: add ioprio support

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolfsr: fix verification and spin bugs
Alex Pyrgiotis [Tue, 12 Mar 2013 08:28:35 +0000 (10:28 +0200)]
lfsr: fix verification and spin bugs

Changes:

1. Verification now works properly and reports for which value it fails
2. Fix a mishandling of spin incrementation which led to multiple
calculation of the same values

Signed-off-by: Alex Pyrgiotis <apyrgio@grnet.gr>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoConditionally include <sys/shm.h> based on OS support. Define missing MAP_HUGETLB...
Oleg [Tue, 12 Mar 2013 07:06:53 +0000 (00:06 -0700)]
Conditionally include <sys/shm.h> based on OS support. Define missing MAP_HUGETLB for Android.

Signed-off-by: Oleg Matcovschi <olegmatcovsky@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoRemove config-host.h on clean.
Oleg Matcovschi [Tue, 12 Mar 2013 07:04:16 +0000 (00:04 -0700)]
Remove config-host.h on clean.

Signed-off-by: Oleg Matcovschi <olegmatcovsky@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolfsr: Fix spin related bug
Alex Pyrgiotis [Sun, 10 Mar 2013 09:58:05 +0000 (10:58 +0100)]
lfsr: Fix spin related bug

On the previous patch on cycle detection, we would incremet spin value
when:

    num_vals % cycle_length == 0

which would evaluate always to true for the first iteration since we
start with num_vals = 0. Only one corner-case is affected by this bug
and this patch should fix it.

Signed-off-by: Alex Pyrgiotis <apyrgio@grnet.gr>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolfsr: indent table
Jens Axboe [Fri, 8 Mar 2013 18:12:15 +0000 (19:12 +0100)]
lfsr: indent table

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd a simple test for LFSR generator
Alex Pyrgiotis [Fri, 8 Mar 2013 12:37:04 +0000 (14:37 +0200)]
Add a simple test for LFSR generator

Adds a simple test suite to check the speed of the LFSR
generator and verify its results. Just run:

    make t/lfsr-test
    ./t/lfsr-test

to compile the test suite and print its usage

Signed-off-by: Alex Pyrgiotis <apyrgio@grnet.gr>
 create mode 100644 t/lfsr-test.c
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoImprove LFSR implementation
Alex Pyrgiotis [Fri, 8 Mar 2013 12:37:03 +0000 (14:37 +0200)]
Improve LFSR implementation

Changes:

1. Use Galois LFSR instead of Fibonacci LFSR.
2. Use XNOR gates instead of XOR gates.
3. Add tap sizes for LFSRs ranging from 3-bits to 15-bits.
4. Add spin parameter.

Rationale:

1. Fibonacci LFSRs have the following drawbacks:

   a. Their next state can not be computed in one cycle, since the input
      bit must be propagated serially through the XOR gates. Galois
  LFSRs however, can be computed instantly with XOR-masks.

   b. Their state changes cannot be considered "irregular", even by I/O
      standards. Actually, if the current state of an n-bit LFSR is x,
  then the next will either be (x >> 1) or (2^n + (x >> 1)). Galois
  LFSRs have instead their XOR gates interleaved with their bits,
  which means that the inner bits are changed as well, besides of
  the shifting. If the number of taps is z, this means that the
  different outcomes are 2^(z + 1).

2. An LFSR with XOR gates has the all-zeroes state as illegal. Since
   zero is valid for most I/O operations, it would be more intuitive to
   use XNOR gates, that have as the all-ones state as illegal.

3. Allow smaller I/O benchmarks to use LFSRs.

4. The spin parameter follows the same rationale as in 1b. To make the
   LFSR outcome "appear" less predictable, we can spin internally the
   LFSR state and produce the i-th number. To understand the spin
   parameter, consider the following state sequence of a 3-bit LFSR:

                             0, 2, 3, 5, 6, 1, 4
   Same LFSR, spin value 2:  0, 3, 6, 4, 2, 5, 1
   But what is the benefit from using spin? Well, the benefits are
   two-fold:

   a. For the same I/O size, we can create a different I/O sequences.

   b. Following the rationale of 1b, we can have more variable outcomes.
      If the spin value is "i" and the taps are "z", the number of
  different outcomes become i * 2^(z + 1).

Signed-off-by: Alex Pyrgiotis <apyrgio@grnet.gr>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix skewed latencies for rate IOPS
SEOKYOUNG KO [Thu, 7 Mar 2013 11:34:31 +0000 (12:34 +0100)]
Fix skewed latencies for rate IOPS

- when -rate_iops is specified, FIO periodically calls usleep() to limit IOPS

- Before usleep(), FIO always wait until the completion of all pending I/O

- For all I/O completions, FIO shows erroneous behavior of logging their
  latency, with that of the longest latency IO sample.

- w/ QD=8/ mixed R:W=33:66, up to 7 samples may get false latency log when
  waiting all I/O completions => False report of latency distribution

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix rate iops with ramp time
SEOKYOUNG KO [Thu, 7 Mar 2013 11:31:04 +0000 (12:31 +0100)]
Fix rate iops with ramp time

When the ramp time is over, fio resets the ->io_issues[]
counters, but not the rwmix counters. This causes a problem
for mixed read/write workloads that are rate limited and
include a ramp time.

Fix it by resetting rwmix_issues with the regular issues.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd --parse-only command line option
Jens Axboe [Thu, 7 Mar 2013 10:31:20 +0000 (11:31 +0100)]
Add --parse-only command line option

Sometimes it's useful just being able to verify whether a job
config is valid or not, without actually starting any jobs.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' into gfio
Jens Axboe [Mon, 4 Mar 2013 11:27:07 +0000 (12:27 +0100)]
Merge branch 'master' into gfio

Conflicts:
init.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: fixup __sync_fetch_and_add()
Jens Axboe [Thu, 28 Feb 2013 21:13:29 +0000 (22:13 +0100)]
configure: fixup __sync_fetch_and_add()

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add general libs for Solaris
Jens Axboe [Thu, 28 Feb 2013 21:10:22 +0000 (22:10 +0100)]
configure: add general libs for Solaris

Assume we just need them, this makes us find inet_aton()
on Solaris too.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agosolaris: ensure that TCP_NODELAY gets picked up
Jens Axboe [Thu, 28 Feb 2013 19:34:31 +0000 (20:34 +0100)]
solaris: ensure that TCP_NODELAY gets picked up

Use proper libs when linking, then we can also remove
those from the Makefile.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' of ssh://brick.kernel.dk/data/git/fio
Jens Axboe [Thu, 28 Feb 2013 19:08:12 +0000 (20:08 +0100)]
Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio

11 years agopowerpc: use mfspr for Time Base Register reads
Steven Noonan [Thu, 28 Feb 2013 19:08:06 +0000 (20:08 +0100)]
powerpc: use mfspr for Time Base Register reads

The 'mftb' and 'mftbu' instructions are deprecated in Power ISA v2.06 in favor
of mfspr. Since CPUs supporting mftb/mftbu also support the TBR SPRs, there's
no known reason to keep mftb/mftbu.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix compile of RDMA engine for SunOS 5.x
Jens Axboe [Thu, 28 Feb 2013 07:28:05 +0000 (08:28 +0100)]
Fix compile of RDMA engine for SunOS 5.x

- byteswap.h include that doesn't exist there. Kill it, we
  have no use for it.

- No RLIMIT_MEMLOCK on SunOS. The use in the engine is a bit
  suspect, so not a problem if we don't have it. Add configure
  check for that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agonet: fix warning for systems without TCP_NODELAY
Jens Axboe [Thu, 28 Feb 2013 07:24:23 +0000 (08:24 +0100)]
net: fix warning for systems without TCP_NODELAY

Signed-off-by: Jens Axboe <axboe@kernel.dk>