Age | Commit message (Collapse) | Author |
|
Bug: N/A
Test: builds, seems to work
Change-Id: I455dcc898f00dc50ae5cb65d1b381982df5a51e0
|
|
Commit 23bd40f944b7 shrank our pool size from 128 pools at 8MB max,
to one static 16MB pool. Christian reports:
"For our tests with about 250k files we found the smalloc pool being
depleted. Now for us values of 3-4 would be enough, but since it is a
compile time switch I'd like to make it safe for everybody and set 8."
Bump the pool alloc to 8 pools again, retaining the 16MB size. That's
still substantially less than before, but should be enough for most
cases. Allocate the pools at init time, to avoid the issue that the
original commit fixed.
Also fix a bug where we failed to iterate some pools when restarting
the allocation scan, resulting in less-than-optimal exhaustion of all
pools before smalloc() gave up and returned NULL.
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
smalloc_strdup didn't check for allocation success and thereby ran into
segfaults if the single pool went out of memory.
Now with this patch applied it is still failing, but in a more consistent
way than segfaulting.
You still get a bad allocation, but it looks like this now:
fio: smalloc OOM
fio: filesetup.c:1495: dup_files: Assertion `0' failed.
Aborted
In fact the upper layers expected smalloc_strdup to retrun NULL on failure.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
We can easily add new pools, but if we do this after jobs have been
forked off, then it wont really be shared storage as the new mmap
mappings will only apply to the process that instantiated them.
Since we moved the randommap mappings to private storage, we should
not need a lot of room for shared allocations. Hence I hope the 16MB
will suffice.
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
If this happens at runtime, stderr/stdout may have been closed
and used for server/client connections.
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
With contributions from Ryan Haynes <rhaynes@fusionio.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
Run analysis on symbols not used outside of their current file,
turn them into statics.
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
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>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Makes the API look cleaner.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Windows uses LLP64 model so [u]intptr_t is more correct.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Jiri reports:
I think I found a bug. If the device (file) used in fio has "wrong" size, and is used with "wrong" block size, the fio fails to allocate memory for randommap.
Following conditions must be true, considering just one thread for simplicity:
1) number of blocks on the device are too big to fill in the default's pool
2) number of blocks on the device must be "right", so the size of newly allocated pool by smalloc.c:add_pool is exactly as big as requested size (there are some roundings in place, so not every size triggers this error)
When this is true, function smalloc.c:__smalloc_pool fails to use the newly created (exactly big enough) pool, because of this line:
idx = find_next_zero(pool->bitmap[i], last_idx);
which always returns non-zero value (the minimum returned value is last_idx +1), and so in our case the idx is 1 even though, the block number 0 is free. As the direct consequence, the function doesn't find enough free space in the given pool and returns NULL pointer. This leads to another try to allocate enough memory in smalloc.c:smalloc_real function, and so on...
The behavior could be reprocuded using both stable 1.57 and git version of the tool. The values that triggers the error are:
init_random_map - real_file_size: 21999995584512, o.rw_min_bs: 4096, blocks: 5371092672, num_maps: 83923323, alloc size: 671386584
whereas this block device is fine:
init_random_map - real_file_size: 19999995985920, o.rw_min_bs: 4096, blocks: 4882811520, num_maps: 76293930, alloc size: 610351440
the configuration file used:
[global]
description=CESNET_test
[cesnet]
filename=/dev/sdd
rw=randread
size=10000g
ioengine=libaio
iodepth=4
bs=4k
runtime=10m
time_based
numjobs=1
group_reporting
Get rid of the +1, it looks like a remnant from when the pools
had a header associated with them.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
|
|
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
|
|
- Update HOWTO to note that directio and fallocate don't work with ZFS
on Solaris.
Refactor the Makefile's to add CPPFLAGS and LIBS.
- Add -fno-omit-frame-pointer from Linux Makefile to every platform
- Change undefined $(ALL_CFLAGS) to $(CFLAGS)
- Pass -std=gnu99, without which OS X fails to build.
- Add -D__EXTENSIONS__ on Solaris since some functions we need are
behind it.
- Pull in <limits.h> in fio.c to get PTHREAD_STACK_MIN.
- NetBSD doesn't define PTHREAD_STACK_MIN so set it to 4k in
os-netbsd.h
- If we have posix_fallocate don't error out if it fails during mutex
and malloc operations since it will fail on Solaris with a ZFS
filesystem. As I understand it these aren't performance-critical
operations so do they need to be considered critical?
- Remove fio_unused from os-* files since it's defined in fio.h and we
don't really need it.
- FreeBSD has an idprio command but not the API so don't claim it does.
- OS X doesn't have the timer_* API so emulate it using
setitimer/sigaction.
- NetBSD and Solaris don't support CLOCK_MONOTONIC in timer_create so
remove FIO_HAVE_CLOCK_MONOTONIC from their os-* files.
I've noticed that a change I made a while ago to use fmin/fmax could
cause issues on older OSes - I had a CD with NetBSD 5.0.2 and found
they had only been implemented in 5.1 so I'm not sure if I should
revert it.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
|
|
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
|
|
If /tmp happens to be full, fio gives you a very unhelpful error:
# ./fio rand-write-256k-q256.job
Bus error
Use posix_fallocate() to gracefully handle this condition.
Signed-off-by: Greg Edwards <greg.edwards@hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
It would SIGBUS on archs that require proper alignment, and work
suboptimally on others. Real fix is pending, making sure that
we always return naturally aligned pointers. But this at least
makes it work on sparc64.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Don't defer until cleanup time, since we may not clean up if fio
crashes or is killed in other ways.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
segmentation fault
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
This reverts commit 3f1959101ed6a935ff3e2aec0fe7f5828f23fbcb.
|
|
Makes the allocator 10-20% faster.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Also get rid of the arch private ffz functions, the generic
one is just fine.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Passes all regressions and tests, must be Bug Free.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
It's a lot cleaner and easier to understand than the previous one,
even if it does waste some more memory.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
The softrandommap job option allows fio to continue if it cannot
allocate from the smalloc backing for the random map. Or the user
can specify --alloc-size with a size larger than the default of 1024k
to increase the size of the shared allocation pool.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
We allocate randommaps from that pool as well and they can grow
quite large.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
Get rid of the semaphore implementation, no need to carry both.
Add different locking modes (exclusive and readwrite) to enable
a wider range of testing. Also combine lockfile and lockfile_batch,
the latter is now a postfix option to the former.
So to enable readers-excluding-writers locking mode with a lock batch
count of 4, you would write:
lockfile=readwrite:4
instead.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|