Skip to contentSkip to conversation

Disabling verify when norandommap is given

DISCUSSION Radha Ramachandran 2 participants 6 messages Feb 18, 2009 – Feb 19, 2009

lore
Share & tools
lore
#0 lore raw

Hi,
Is there a reason why there is a hard rule to disable verify when norandommap option is also set?
Thanks
-radha

#1 lore raw
Quoted 3 lines · Radha Ramachandran

Hi,
Is there a reason why there is a hard rule to disable verify when norandommap option is also set?

Without a map of the blocks that have been written already, you might overwrite full or partial blocks before you are done. That would cause verify to fail. See the 'norandommap' explanation in the HOWTO as well.

Signature · 1 line
Jens Axboe
#2 lore raw

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.
Thanks
-radha

Quoted 17 lines · Jens Axboe
Quoted 3 lines · Radha Ramachandran

Hi,
Is there a reason why there is a hard rule to disable verify when norandommap option is also set?

Without a map of the blocks that have been written already, you might overwrite full or partial blocks before you are done. That would cause verify to fail. See the 'norandommap' explanation in the HOWTO as well.

--
Jens Axboe

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

#3 lore raw
Quoted 7 lines · Radha Ramachandran

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.

init.c +11 -2
index 95c282a..001e5c4 100644
@@ -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))
Signature · 1 line
Jens Axboe
#4 lore raw

Yes, this works for me.
Thanks for looking into this.
-radha

Quoted 57 lines · Jens Axboe
Quoted 7 lines · Radha Ramachandran

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.

init.c +11 -3
index 95c282a..001e5c4 100644
@@ -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

#5 lore raw
Quoted 2 lines · Radha Ramachandran

Yes, this works for me.
Thanks for looking into this.

Thanks for testing, I'll double check and test myself tomorrow and then integrate.

Quoted 60 lines

-radha

Quoted 57 lines · Jens Axboe
Quoted 7 lines · Radha Ramachandran

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.

init.c +11 -3
index 95c282a..001e5c4 100644
@@ -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

Signature · 1 line
Jens Axboe