Re: Disabling verify when norandommap is given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 19 2009, Radha Ramachandran wrote:
> Yes, that makes sense for a randwrite operation.
> But is it acceptable to allow norandommap with verify for
> read/randomread only operations with no writes involved. The case Iam
> specifically interested in is doing sequential writes followed by
> sequential reads (with verify) and then randomaccess reads (with
> verify). For a small enough block size on a large enough drive the
> norandommap takes up too much memory.

The memory usage is indeed problematic, that is why the option exists.
I'd be very happy to slim that down...

What you suggest will work, but only for fixed size blocks. Once you
have varying block sizes, a given random minimum block offset may be
inside a verify block, not at the start of it.

So I guess the 'norandommap disables verify' can be relaxed to
'norandommap disables verify IFF non-fixed block sizes are used'. I'm
assuming that would work for you? Please try the below patch. If
succesful, I'll augment it with an updated HOWTO description.

diff --git a/init.c b/init.c
index 95c282a..001e5c4 100644
--- a/init.c
+++ b/init.c
@@ -206,6 +206,13 @@ static int setup_rate(struct thread_data *td)
 	return 0;
 }
 
+static int fixed_block_size(struct thread_options *o)
+{
+	return o->min_bs[DDIR_READ] == o->max_bs[DDIR_READ] &&
+		o->min_bs[DDIR_WRITE] == o->max_bs[DDIR_WRITE] &&
+		o->min_bs[DDIR_READ] == o->min_bs[DDIR_WRITE];
+}
+
 /*
  * Lazy way of fixing up options that depend on each other. We could also
  * define option callback handlers, but this is easier.
@@ -269,8 +276,10 @@ static int fixup_options(struct thread_data *td)
 	if (!o->file_size_high)
 		o->file_size_high = o->file_size_low;
 
-	if (o->norandommap && o->verify != VERIFY_NONE) {
-		log_err("fio: norandommap given, verify disabled\n");
+	if (o->norandommap && o->verify != VERIFY_NONE
+	    && !fixed_block_size(o))  {
+		log_err("fio: norandommap given for variable block sizes, "
+			"verify disabled\n");
 		o->verify = VERIFY_NONE;
 	}
 	if (o->bs_unaligned && (o->odirect || td->io_ops->flags & FIO_RAWIO))

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux