Flexible I/O Tester development
 help / color / mirror / Atom feed
* [RFC] [PATCH] Allow random overwrite workloads to write io_limit
@ 2015-02-13 23:17 Justin Eno (jeno)
  2015-02-16 22:00 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Justin Eno (jeno) @ 2015-02-13 23:17 UTC (permalink / raw)
  To: fio@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

For a (random) overwrite workload, 'size' amount of access doesn't correspond to
each byte on the target having been touched, so setting size as the limit between
write- and verify-phases doesn't really apply.  The attached patch proposes to
instead use io_limit as the limit if it's set.

io_limit < size is already handled by subsequent logic.  This patch just allows
for io_limit > size.

Thanks,
Justin

[-- Attachment #2: io_limit.patch --]
[-- Type: application/octet-stream, Size: 1661 bytes --]

From 950c4d0b6c800beedb2e4afb27bb7ae5d04c2848 Mon Sep 17 00:00:00 2001
From: Justin Eno <jeno@micron.com>
Date: Thu, 29 Jan 2015 12:27:58 -0800
Subject: [PATCH] Allow random overwrite workloads to write io_limit

Limiting the write phase of (random) overwrite workloads to 'size'
before the verify phase doesn't make sense, so allow them to write
up to io_limit.  This better matches verify_only behavior, and
allows the [verify-job] below to succeed:

[global]
thread=1
direct=1
ioengine=sync
verify=meta
bs=1k
offset=0
size=5M
io_limit=6M
norandommap=1
verify_fatal=1
randseed=42

[write-job]
filename=datafile.tmp
rw=randwrite
do_verify=0

[verify-job]
stonewall
create_serialize=0
filename=datafile.tmp
rw=randwrite
do_verify=1
verify_only=1

Signed-off-by: Justin Eno <jeno@micron.com>
---
 backend.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/backend.c b/backend.c
index 7ec8d2a..0f4b7c0 100644
--- a/backend.c
+++ b/backend.c
@@ -724,12 +724,18 @@ static uint64_t do_io(struct thread_data *td)
 
 	lat_target_init(td);
 
+	total_bytes = td->o.size;
+	/*
+	* Allow random overwrite workloads to write up to io_limit
+	* before starting verification phase as 'size' doesn't apply.
+	*/
+	if (td_write(td) && td_random(td) && td->o.norandommap)
+		total_bytes = max(total_bytes, (uint64_t) td->o.io_limit);
 	/*
 	 * If verify_backlog is enabled, we'll run the verify in this
 	 * handler as well. For that case, we may need up to twice the
 	 * amount of bytes.
 	 */
-	total_bytes = td->o.size;
 	if (td->o.verify != VERIFY_NONE &&
 	   (td_write(td) && td->o.verify_backlog))
 		total_bytes += td->o.size;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] [PATCH] Allow random overwrite workloads to write io_limit
  2015-02-13 23:17 [RFC] [PATCH] Allow random overwrite workloads to write io_limit Justin Eno (jeno)
@ 2015-02-16 22:00 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-02-16 22:00 UTC (permalink / raw)
  To: Justin Eno (jeno), fio@vger.kernel.org

On 02/13/2015 04:17 PM, Justin Eno (jeno) wrote:
> For a (random) overwrite workload, 'size' amount of access doesn't correspond to
> each byte on the target having been touched, so setting size as the limit between
> write- and verify-phases doesn't really apply.  The attached patch proposes to
> instead use io_limit as the limit if it's set.
>
> io_limit < size is already handled by subsequent logic.  This patch just allows
> for io_limit > size.

Thanks Justin, applied.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-16 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 23:17 [RFC] [PATCH] Allow random overwrite workloads to write io_limit Justin Eno (jeno)
2015-02-16 22:00 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox