Re: extra I/O at the start of disk zone test?

From: Jens Axboe <jens.axboe_at_oracle.com>
Date: Thu, 31 Jan 2008 13:25:19 +0100

On Thu, Jan 31 2008, Ryan Thomas wrote:
> With the following job description
>
>
> [global]
> bs=1k
> direct=1
> rw=read
> ioengine=libaio
> iodepth=2
> zonesize=1k
> zoneskip=1023k
> write_bw_log
>
> [/dev/cciss/c0d1]
> write_iolog=foo2
>
> The idea here is that I wanted to line up my zones to start at 1M
> boundaries across the disk by writing 1k and skipping the next 1023k.
> In practice I don't get the alignment because of an extra initial I/O.
> I get an iolog that looks like
>
>
>
> # head foo2
>
> fio version 2 iolog
>
> /dev/cciss/c0d1 add
>
> /dev/cciss/c0d1 open
>
> /dev/cciss/c0d1 read 0 1024
>
> /dev/cciss/c0d1 read 1024 1024
>
> /dev/cciss/c0d1 read 1049600 1024
>
> /dev/cciss/c0d1 read 2098176 1024
>
>
>
> There's a read that I don't expect in that log, namely the read starting
> at byte 1024. Because that read is there, the disk zones get offset by
> one block. I expected output like

It's due to how fio accounts the zone bytes. Right now it does them when
the io completes, but that's clearly not correct for iodepth > 1. The
patch below should fix things up for you, can you confirm it works?

diff --git a/io_u.c b/io_u.c
index 7890a87..8201ccd 100644
--- a/io_u.c
+++ b/io_u.c
@@ -375,6 +375,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
          * If using a write iolog, store this entry.
          */
 out:
+ td->zone_bytes += io_u->buflen;
         log_io_u(td, io_u);
         return 0;
 }
@@ -765,7 +766,6 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
 
                 td->io_blocks[idx]++;
                 td->io_bytes[idx] += bytes;
- td->zone_bytes += bytes;
                 td->this_io_bytes[idx] += bytes;
 
                 io_u->file->last_completed_pos = io_u->endpos;

-- 
Jens Axboe
Received on Thu Jan 31 2008 - 13:25:19 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 31 2008 - 13:30:01 CET