fio.git
11 years agoconfigure: add TCP_NODELAY check
Jens Axboe [Thu, 31 Jan 2013 09:19:51 +0000 (10:19 +0100)]
configure: add TCP_NODELAY check

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agowindows: fix typo in <netinet/tcp.h> header
Jens Axboe [Thu, 31 Jan 2013 08:58:22 +0000 (09:58 +0100)]
windows: fix typo in <netinet/tcp.h> header

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix bugs in [v]snprintf usage
Ken Raeburn [Wed, 30 Jan 2013 21:31:09 +0000 (22:31 +0100)]
Fix bugs in [v]snprintf usage

When calling snprintf, supply the full buffer size instead of
one byte less.

When using the returned length from vsnprintf for logging, don't write
more than the actual buffer size (minus one for the trailing \0), in
case the formatted string was truncated.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd empty <netinet/tcp.h> for Windows
Jens Axboe [Wed, 30 Jan 2013 20:54:58 +0000 (21:54 +0100)]
Add empty <netinet/tcp.h> for Windows

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agonet: fix compile warning on Windows (and others)
Jens Axboe [Wed, 30 Jan 2013 20:52:37 +0000 (21:52 +0100)]
net: fix compile warning on Windows (and others)

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agonet engine: implement option "nodelay" for TCP sockets
Steven Noonan [Wed, 28 Nov 2012 22:52:36 +0000 (14:52 -0800)]
net engine: implement option "nodelay" for TCP sockets

With disks, O_DIRECT effectively bypasses all buffering/caching mechanisms and
ensures that the I/O is going directly to the disk. Since TCP is a streaming
protocol (like disk I/O), it also has a buffering mechanism. As with disks, it
is sometimes desirable to bypass buffering. To that end, we can use
TCP_NODELAY, which transmits the packet as soon as data is assembled,
regardless of whether it occupies a full frame.

Signed-off-by: Steven Noonan <snoonan@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoidletime: style cleanups
Jens Axboe [Wed, 30 Jan 2013 13:08:00 +0000 (14:08 +0100)]
idletime: style cleanups

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add SCHED_IDLE check
Jens Axboe [Wed, 30 Jan 2013 12:58:58 +0000 (13:58 +0100)]
configure: add SCHED_IDLE check

We can't consider it always available on Linux. It fails on
Debian 6.x, for instance.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd support for idletime profiling
Huadong Liu [Wed, 30 Jan 2013 12:22:24 +0000 (13:22 +0100)]
Add support for idletime profiling

Idletime profiling allows a benchmark to run while filling the
idle cycles on the server, hence giving you some metric of how
much pressure the system is under. This is useful to be able
to profile and compare changes in a setup or driver, for instance.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd unified_rw_reporting option
Jens Axboe [Wed, 30 Jan 2013 11:56:23 +0000 (12:56 +0100)]
Add unified_rw_reporting option

If this is set, then fio will sum and display just a single set
of statistics for any IO type. By default, fio accounts and reports
each data direction separately.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoHOWTO: indentation fix
Jens Axboe [Wed, 30 Jan 2013 11:53:55 +0000 (12:53 +0100)]
HOWTO: indentation fix

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agosmalloc: alloc failure cleanups
Jens Axboe [Tue, 29 Jan 2013 21:29:09 +0000 (22:29 +0100)]
smalloc: alloc failure cleanups

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoclient/server: fixup missing TRIM conversions
Jens Axboe [Tue, 29 Jan 2013 19:53:52 +0000 (20:53 +0100)]
client/server: fixup missing TRIM conversions

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix crash with absurdly but not impossibly deeply nested device stacks
Ken Raeburn [Tue, 29 Jan 2013 09:18:13 +0000 (10:18 +0100)]
Fix crash with absurdly but not impossibly deeply nested device stacks

Use the proper PATH_MAX for the max path for disk util, and use
snprintf() to avoid potentially overwriting it.

Modified by Jens to return NULL instead of exiting.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: enable --extra-cflags for Windows
Jens Axboe [Tue, 29 Jan 2013 09:06:30 +0000 (10:06 +0100)]
configure: enable --extra-cflags for Windows

Add configure help as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add --extra-cflags
Jens Axboe [Tue, 29 Jan 2013 08:26:07 +0000 (09:26 +0100)]
configure: add --extra-cflags

And ensure that -D_GNU_SOURCE is being set for configure test
programs too.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix Windows build by defining clock sources and adding include file.
Bruce Cran [Mon, 28 Jan 2013 16:07:15 +0000 (16:07 +0000)]
Fix Windows build by defining clock sources and adding include file.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAlways fsync if asked to
Jens Axboe [Sat, 26 Jan 2013 16:28:23 +0000 (09:28 -0700)]
Always fsync if asked to

Currently we don't fsync() is direct IO is issued. But if the
user asked for fsync(), he should get an fsync. So remove this
restriction.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix getopt def check
Jens Axboe [Fri, 25 Jan 2013 21:36:46 +0000 (14:36 -0700)]
Fix getopt def check

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: HPUX warning for empty CC
Jens Axboe [Fri, 25 Jan 2013 21:35:27 +0000 (14:35 -0700)]
configure: HPUX warning for empty CC

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMakefile: remove config-host.ld
Jens Axboe [Fri, 25 Jan 2013 15:52:43 +0000 (08:52 -0700)]
Makefile: remove config-host.ld

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add configure header to config-host.h
Jens Axboe [Fri, 25 Jan 2013 15:52:28 +0000 (08:52 -0700)]
configure: add configure header to config-host.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: auto-generate a config-host.h
Jens Axboe [Fri, 25 Jan 2013 06:07:55 +0000 (23:07 -0700)]
configure: auto-generate a config-host.h

Don't have all these special cases to convert a .mak to a .h define,
just generate it from the configure script instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoDrop EXTFLAG and lib references
Jens Axboe [Thu, 24 Jan 2013 22:38:37 +0000 (15:38 -0700)]
Drop EXTFLAG and lib references

They are picked up automatically now.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: kill windows FIO_HAVE_FDATASYNC
Jens Axboe [Thu, 24 Jan 2013 22:35:17 +0000 (15:35 -0700)]
configure: kill windows FIO_HAVE_FDATASYNC

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: solaris and windowsaio fixups
Jens Axboe [Thu, 24 Jan 2013 22:33:33 +0000 (15:33 -0700)]
configure: solaris and windowsaio fixups

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agooptions: add help to experimental_verify
Jens Axboe [Thu, 24 Jan 2013 22:29:58 +0000 (15:29 -0700)]
options: add help to experimental_verify

Option help is required...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: fix more old FIO_HAVE_ checks
Jens Axboe [Thu, 24 Jan 2013 22:27:40 +0000 (15:27 -0700)]
configure: fix more old FIO_HAVE_ checks

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoNAN: use __builtin_nanf() if not available
Jens Axboe [Thu, 24 Jan 2013 22:22:20 +0000 (15:22 -0700)]
NAN: use __builtin_nanf() if not available

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agohash: make 64-bit type ULL
Jens Axboe [Thu, 24 Jan 2013 22:21:04 +0000 (15:21 -0700)]
hash: make 64-bit type ULL

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoCorrect ifdef checks for posix and linux fallocate
Jens Axboe [Thu, 24 Jan 2013 22:00:25 +0000 (15:00 -0700)]
Correct ifdef checks for posix and linux fallocate

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add that windows has RUSGE_THREAD
Jens Axboe [Thu, 24 Jan 2013 21:53:47 +0000 (14:53 -0700)]
configure: add that windows has RUSGE_THREAD

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd lib/getrusage.c
Jens Axboe [Thu, 24 Jan 2013 21:20:09 +0000 (14:20 -0700)]
Add lib/getrusage.c

Abstract out the SELF/THREAD complication.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUse RUSAGE_THREAD, if available
Huadong Liu [Thu, 24 Jan 2013 21:07:20 +0000 (14:07 -0700)]
Use RUSAGE_THREAD, if available

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoinit: complain on unrecognized option with builtin getopt_long_only()
Jens Axboe [Thu, 24 Jan 2013 01:11:48 +0000 (18:11 -0700)]
init: complain on unrecognized option with builtin getopt_long_only()

It returns '?' for a bad option, whereas the glibc one does
not. Catch that so we behave identically.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix compile warnings on Windows
Jens Axboe [Thu, 24 Jan 2013 00:21:41 +0000 (17:21 -0700)]
Fix compile warnings on Windows

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agowindows: don't provide strsep(), fio already has one
Jens Axboe [Wed, 23 Jan 2013 23:28:24 +0000 (16:28 -0700)]
windows: don't provide strsep(), fio already has one

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add default compiler on Windows
Jens Axboe [Wed, 23 Jan 2013 23:26:12 +0000 (16:26 -0700)]
configure: add default compiler on Windows

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: fixup Windows
Jens Axboe [Wed, 23 Jan 2013 23:23:48 +0000 (16:23 -0700)]
configure: fixup Windows

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add endian check
Jens Axboe [Wed, 23 Jan 2013 22:42:16 +0000 (15:42 -0700)]
configure: add endian check

Will remove guesswork and manual hacking in the OS headers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoKill now unneeded clock definitions
Jens Axboe [Wed, 23 Jan 2013 22:29:59 +0000 (15:29 -0700)]
Kill now unneeded clock definitions

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoOSX: Fixup warnings and clock_gettime() bug
Jens Axboe [Wed, 23 Jan 2013 21:02:23 +0000 (14:02 -0700)]
OSX: Fixup warnings and clock_gettime() bug

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: remember to output CC for windows
Jens Axboe [Wed, 23 Jan 2013 20:51:39 +0000 (13:51 -0700)]
configure: remember to output CC for windows

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: add --cc= option to script
Jens Axboe [Wed, 23 Jan 2013 20:47:54 +0000 (13:47 -0700)]
configure: add --cc= option to script

Get rid of uname -o usage for Windows, and specifically require
CC=bla ./configure or ./configure --cc=bla to set something else
than gcc.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix 32-bit compile warning in should_check_rate()
Jens Axboe [Wed, 23 Jan 2013 20:35:14 +0000 (13:35 -0700)]
Fix 32-bit compile warning in should_check_rate()

Introduced with the change from unsigned long -> uint64_T

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agot/axmap: update to catch recent bugs
Jens Axboe [Wed, 23 Jan 2013 18:02:07 +0000 (11:02 -0700)]
t/axmap: update to catch recent bugs

Also properly include axmap.h and don't declare our own prototypes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: ensure that we never return a value that is larger than the map size
Jens Axboe [Wed, 23 Jan 2013 18:01:09 +0000 (11:01 -0700)]
axmap: ensure that we never return a value that is larger than the map size

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: improve axmap_find_first_free()
Jens Axboe [Wed, 23 Jan 2013 17:33:20 +0000 (10:33 -0700)]
axmap: improve axmap_find_first_free()

Add a ret variable, saves a branch on return.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoverify: stop on actual number of bytes needed to be verified
Jens Axboe [Wed, 23 Jan 2013 17:15:57 +0000 (10:15 -0700)]
verify: stop on actual number of bytes needed to be verified

If we don't use LFSR or a random map, we don't get told when
to stop by the random generator or map. So track it on the
side, using the same mechanism as do_io().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: fix bug in axmap_find_first_free()
Jens Axboe [Wed, 23 Jan 2013 17:15:05 +0000 (10:15 -0700)]
axmap: fix bug in axmap_find_first_free()

If the map is completely full, we could return an invalid value
for the first free bit. So check if we actually found a match,
return failure if we didn't.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMake experimental_verify=1 handle all cases properly
Jens Axboe [Wed, 23 Jan 2013 16:27:25 +0000 (09:27 -0700)]
Make experimental_verify=1 handle all cases properly

- Don't track written bytes, just replay the workload by resetting
  all the random generators. This should work for any mixture of IO.

- Handle trims for verify.

- Ensure that rwmix is replayed properly for verify.

- Fixup logging for replay.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoEnsure all random seeds are repeatable for randrepeat=1
Jens Axboe [Wed, 23 Jan 2013 16:26:53 +0000 (09:26 -0700)]
Ensure all random seeds are repeatable for randrepeat=1

Currently we only do the offset.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoeta: improve accuracy for rwmix workloads and verify
Jens Axboe [Wed, 23 Jan 2013 15:40:11 +0000 (08:40 -0700)]
eta: improve accuracy for rwmix workloads and verify

We assume 50/50 for mixed workloads. That's silly, use the actual
number specified instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUse unsigned long long for the uint64_t type
Jens Axboe [Mon, 21 Jan 2013 19:30:34 +0000 (12:30 -0700)]
Use unsigned long long for the uint64_t type

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agowindows: use hweight64(), it's a 64-bit type
Jens Axboe [Mon, 21 Jan 2013 19:28:42 +0000 (12:28 -0700)]
windows: use hweight64(), it's a 64-bit type

Courtesy of Bruce.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd hweight64()
Jens Axboe [Mon, 21 Jan 2013 19:28:23 +0000 (12:28 -0700)]
Add hweight64()

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix _SC_NPROCESSORS_ONLN on Windows
Bruce Cran [Mon, 21 Jan 2013 17:57:59 +0000 (10:57 -0700)]
Fix _SC_NPROCESSORS_ONLN on Windows

_SC_NPROCESSORS_ONLN was returning the wrong value on Windows because
GetLogicalProcessorInformation() returns data about caches, nodes and
packages in addition to processors.

Modified by Jens to use hweight32()

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd generic hweight helpers
Jens Axboe [Mon, 21 Jan 2013 17:55:02 +0000 (10:55 -0700)]
Add generic hweight helpers

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoverify: add new experimental mode that requires no meta data
Jens Axboe [Mon, 21 Jan 2013 16:47:03 +0000 (09:47 -0700)]
verify: add new experimental mode that requires no meta data

Should work fine, but we need to account and track trims to know
which blocks NOT to verify (or verify as zero).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoRe-seed random generator when a file is reset
Jens Axboe [Mon, 21 Jan 2013 16:46:06 +0000 (09:46 -0700)]
Re-seed random generator when a file is reset

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoaxmap: clear map->first_free when we reset it
Jens Axboe [Mon, 21 Jan 2013 16:43:30 +0000 (09:43 -0700)]
axmap: clear map->first_free when we reset it

Otherwise it could be left at an invalid value. When we clear the map,
we know the first free bit is 0.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolfsr: add lfsr_reset()
Jens Axboe [Mon, 21 Jan 2013 16:42:49 +0000 (09:42 -0700)]
lfsr: add lfsr_reset()

This enables us to restart a sequence.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogettime: use proper uint64_t types where needed
Jens Axboe [Mon, 21 Jan 2013 12:38:22 +0000 (05:38 -0700)]
gettime: use proper uint64_t types where needed

Windows has 32-bit longs even on 64-bit, so we risk overflowing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd info log on whether tsc is reliable or not for --cpuclock-test
Jens Axboe [Fri, 18 Jan 2013 19:13:45 +0000 (20:13 +0100)]
Add info log on whether tsc is reliable or not for --cpuclock-test

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoWindows: fix off-by-one error in fio_cpu_set and add affinity error messages.
Bruce Cran [Fri, 18 Jan 2013 13:13:13 +0000 (13:13 +0000)]
Windows: fix off-by-one error in fio_cpu_set and add affinity error messages.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMake hugetlbfs maping work
Shaohua Li [Thu, 17 Jan 2013 12:28:15 +0000 (13:28 +0100)]
Make hugetlbfs maping work

If it's a file mapping, flags must be MAP_HARED; If it's an anonymous
mapping, flags must be MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB (can be
shared, but doesn't matter here).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agofusion-aw: make configure and compile actually work
Jens Axboe [Mon, 14 Jan 2013 18:33:40 +0000 (19:33 +0100)]
fusion-aw: make configure and compile actually work

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agofusion-aw: fixes
Jens Axboe [Mon, 14 Jan 2013 18:22:15 +0000 (19:22 +0100)]
fusion-aw: fixes

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: use exit 0 instead of just exit
Jens Axboe [Mon, 14 Jan 2013 18:21:55 +0000 (19:21 +0100)]
configure: use exit 0 instead of just exit

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix typo (READ/DDIR_READ).
Bruce Cran [Sun, 13 Jan 2013 17:21:58 +0000 (17:21 +0000)]
Fix typo (READ/DDIR_READ).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix configure script for 64-bit Windows.
Bruce Cran [Sun, 13 Jan 2013 17:10:25 +0000 (17:10 +0000)]
Fix configure script for 64-bit Windows.

Hard-code config options when building using MinGW-w64 on Windows.
For 32-bit builds, CC and CONFIG_32BIT/CONFIG_64BIT will need to be
updated manually.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd CONFIG_64BIT_LLP64, CONFIG_POSIX_FALLOCATE and CONFIG_LINUX_FALLOCATE to Makefile.
Bruce Cran [Sun, 13 Jan 2013 17:09:22 +0000 (17:09 +0000)]
Add CONFIG_64BIT_LLP64, CONFIG_POSIX_FALLOCATE and CONFIG_LINUX_FALLOCATE to Makefile.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoImprove documentation for end_fsync
Jens Axboe [Sun, 13 Jan 2013 16:16:46 +0000 (17:16 +0100)]
Improve documentation for end_fsync

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoconfigure: enable e4defrag engine regardless of MOVE_EXTENT compile test
Jens Axboe [Sat, 12 Jan 2013 09:27:53 +0000 (10:27 +0100)]
configure: enable e4defrag engine regardless of MOVE_EXTENT compile test

It may exist in the running kernel, even if the defines
and structures haven't bubbled back into userspace yet.
The engine carries it's own check and structure define
for that case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoPre-load and sort random blocks for pure read verify workloads
Jens Axboe [Sat, 12 Jan 2013 08:44:15 +0000 (01:44 -0700)]
Pre-load and sort random blocks for pure read verify workloads

If fio is run with a write phase before a read phase and the
IO type is random, the end read verify phase will get sorted
blocks to read back. But if fio is asked to verify something
that was previously randomly written, it will generate the
same random offsets in random order and verify those. This is
usually much slower than a sorted read back.

So add a verifysort_nr option that allows the user to specify
a number of random offsets to pre-generate and sort, before
reading them and verifying the contents. This greatly speeds
up pure read verify workloads.

Default to 1024, and put a max of 64K entries on the option.
We do a merge list sort on the entries, so we don't want a
huge amount of backlog.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolfsr: ensure we don't generate an offset + buflen that exceeds the max size
Jens Axboe [Fri, 11 Jan 2013 13:03:25 +0000 (14:03 +0100)]
lfsr: ensure we don't generate an offset + buflen that exceeds the max size

Currently we check for the max value, but that doesn't always
work since it may not fit the minimum block size (even if it
is guaranteed to be smaller than the max offset). Pass in the
last valid block.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agofilesetup: limit rand map to the actual IO size, if needed
Jens Axboe [Fri, 11 Jan 2013 13:03:05 +0000 (14:03 +0100)]
filesetup: limit rand map to the actual IO size, if needed

No need allocating a larger map than we need.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd a check avoid segfault
Jianpeng Ma [Fri, 11 Jan 2013 07:52:55 +0000 (08:52 +0100)]
Add a check avoid segfault

If new_size was zero or realloc failed, it would be segment fault.
So add a check.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoRemove repeated --readonly options in documentation
Jianpeng Ma [Thu, 10 Jan 2013 12:20:02 +0000 (13:20 +0100)]
Remove repeated --readonly options in documentation

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix a potential integer overflow
Jianpeng Ma [Thu, 10 Jan 2013 12:19:27 +0000 (13:19 +0100)]
Fix a potential integer overflow

Because nr_files and new_size are not same types.It can cause new_size
less than zero.Then realloc will be failed.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoAdd configure script
Jens Axboe [Thu, 10 Jan 2013 10:23:19 +0000 (11:23 +0100)]
Add configure script

Get rid of all the fragile guessing and checking of features,
and roll a configure script instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix variable type warning
Jens Axboe [Wed, 9 Jan 2013 10:46:01 +0000 (11:46 +0100)]
Fix variable type warning

Bruce reports:

With 2.0.13 on FreeBSD there's also a warning from client.c:

client.c:24:18: warning: field 'eta' with variable sized type 'struct
jobs_eta' not at the end of a struct or class is a GNU extension [-Wgnu]
         struct jobs_eta eta;

Re-order ->eta and ->pending.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFio 2.0.13 fio-2.0.13
Jens Axboe [Wed, 9 Jan 2013 10:01:55 +0000 (11:01 +0100)]
Fio 2.0.13

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoFix potential null pointer dereference on verify and requeue events
Jens Axboe [Tue, 8 Jan 2013 20:02:14 +0000 (21:02 +0100)]
Fix potential null pointer dereference on verify and requeue events

We clear io_u to NULL, but later we derefence io_u to check
the data direction. Do as we do in the main IO loop - store
the data direction in a local variable, and use that after
the main switch.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoserver: move fio_net_cmd to the end of fio_net_int_cmd
Jens Axboe [Tue, 8 Jan 2013 12:43:14 +0000 (13:43 +0100)]
server: move fio_net_cmd to the end of fio_net_int_cmd

fio_net_cmd is variably sized. We don't use any transfer space
for the internal command, but the compiler might complain about
this (since it has no way to know this fact). Move fio_net_cmd
to the end of the internal command to both avoid a warning on
clang and to make this more idiot proof.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUse variable[] instead of GCC variable[0] syntax
Jens Axboe [Tue, 8 Jan 2013 12:42:41 +0000 (13:42 +0100)]
Use variable[] instead of GCC variable[0] syntax

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoEnable -ffast-math
Jens Axboe [Tue, 8 Jan 2013 12:41:35 +0000 (13:41 +0100)]
Enable -ffast-math

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agotime: convert to uint64_t
Jens Axboe [Fri, 4 Jan 2013 12:24:52 +0000 (13:24 +0100)]
time: convert to uint64_t

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoUse uintptr_t for engine data
Jens Axboe [Fri, 4 Jan 2013 12:21:23 +0000 (13:21 +0100)]
Use uintptr_t for engine data

Gets rid of a warning on 32-bit builds on Linux.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoStart of transition from unsigned long long to uint64_t
Jens Axboe [Fri, 4 Jan 2013 12:16:54 +0000 (13:16 +0100)]
Start of transition from unsigned long long to uint64_t

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agozipf/pareto: use min of file size and io size for init
Jens Axboe [Fri, 4 Jan 2013 12:09:29 +0000 (13:09 +0100)]
zipf/pareto: use min of file size and io size for init

It is valid to use size=foo, where foo is larger than the size
of the file or device. For that case, we don't want offsets
larger than the size of the file. So use the minimum of the
real or given size.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMerge branch 'master' of ssh://brick.kernel.dk/data/git/fio
Jens Axboe [Fri, 4 Jan 2013 07:27:06 +0000 (08:27 +0100)]
Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio

11 years agozipf/pareto: use size= if given, not always device size
Jens Axboe [Fri, 4 Jan 2013 07:26:10 +0000 (08:26 +0100)]
zipf/pareto: use size= if given, not always device size

We used the full device/file size for the zipf or pareto init,
this breaks if size= is specifically given. This causes fio
to generate offsets outside the specified size= range, and fio
will then just exit.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agolibaio: use container_of() instead of silly casting
Jens Axboe [Wed, 2 Jan 2013 11:55:41 +0000 (12:55 +0100)]
libaio: use container_of() instead of silly casting

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Conflicts:
engines/libaio.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agogettime: even rounding, don't always round up
Jens Axboe [Tue, 1 Jan 2013 12:38:18 +0000 (13:38 +0100)]
gettime: even rounding, don't always round up

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMove 'tsc_reliable' outside of ARCH_HAVE_CPU_CLOCK
Jens Axboe [Tue, 1 Jan 2013 09:59:04 +0000 (10:59 +0100)]
Move 'tsc_reliable' outside of ARCH_HAVE_CPU_CLOCK

Otherwise we fail building on architectures that do not define
it, as reported by Dan:

cc -o gettime.o -c -std=gnu99 -Wwrite-strings -Wall -O3 -g -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10
-DFIO_VERSION='"fio-2.0.12.2"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG gettime.c
gettime.c: In function 'fio_clock_init':
gettime.c:317:6: error: 'tsc_reliable' undeclared (first use in this function)
gettime.c:317:6: note: each undeclared identifier is reported only once for each function it appears in
make: *** [gettime.o] Error 1

Reported-by: Dan Horák <dan@danny.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoimplement get_cpu_clock() for s390/s390x
Dan Horák [Sun, 30 Dec 2012 22:03:36 +0000 (17:03 -0500)]
implement get_cpu_clock() for s390/s390x

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoclock: turn expensive division into multiply + cheap division
Jens Axboe [Fri, 21 Dec 2012 21:54:56 +0000 (22:54 +0100)]
clock: turn expensive division into multiply + cheap division

On x86-64, dividing by a variable turns into a hugely expensive
divq. It's much cheaper to invert the division. Instead of
dividing clocks by clocks-per-usec, multiply by a 16M/clocks-per-usec
constant instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agot/axmap: update tester for lfsr_init() taking a seed argument
Jens Axboe [Fri, 21 Dec 2012 20:32:50 +0000 (21:32 +0100)]
t/axmap: update tester for lfsr_init() taking a seed argument

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoInclude <stdint.h> before checking __WORDSIZE
Jens Axboe [Fri, 21 Dec 2012 20:29:30 +0000 (21:29 +0100)]
Include <stdint.h> before checking __WORDSIZE

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