Add softrandommap and --alloc-size options
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>
diff --git a/smalloc.c b/smalloc.c
index fd0e9bd..5baf5a4 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -19,8 +19,10 @@
#define INITIAL_SIZE 1048576 /* new pool size */
#define MAX_POOLS 32 /* maximum number of pools to setup */
+unsigned int smalloc_pool_size = INITIAL_SIZE;
+
#ifdef ENABLE_RESIZE
-#define MAX_SIZE 8 * INITIAL_SIZE
+#define MAX_SIZE 8 * smalloc_pool_size
static unsigned int resize_error;
#endif
@@ -229,7 +231,7 @@
if (fd < 0)
goto out_close;
- pool->size = INITIAL_SIZE;
+ pool->size = smalloc_pool_size;
if (ftruncate(fd, pool->size) < 0)
goto out_unlink;