All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 8/9] fio: fix last block never being touched by random offsets
@ 2014-02-20 13:20 ehrhardt
  2014-02-20 17:18 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: ehrhardt @ 2014-02-20 13:20 UTC (permalink / raw)
  To: fio; +Cc: oberpar, Christian Ehrhardt

*Resend with hopefully non mangled patches*
References: <20140220131958.965092001@linux.vnet.ibm.com>
Content-Disposition: inline; filename=fix_last_block.diff

From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>

Fix the available range for random offsets which never touched the last block.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
 io_u.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/io_u.c
+++ b/io_u.c
@@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct
 
 		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
 
-		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
+		*b = lastb * (r / ((uint64_t) rmax + 1.0));
 	} else {
 		uint64_t off = 0;
 


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

* Re: [patch 8/9] fio: fix last block never being touched by random offsets
  2014-02-20 13:20 [patch 8/9] fio: fix last block never being touched by random offsets ehrhardt
@ 2014-02-20 17:18 ` Jens Axboe
  2014-02-28 16:46   ` Peter Oberparleiter
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2014-02-20 17:18 UTC (permalink / raw)
  To: ehrhardt; +Cc: fio, oberpar

On Thu, Feb 20 2014, ehrhardt@linux.vnet.ibm.com wrote:
> *Resend with hopefully non mangled patches*
> References: <20140220131958.965092001@linux.vnet.ibm.com>
> Content-Disposition: inline; filename=fix_last_block.diff
> 
> From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
> 
> Fix the available range for random offsets which never touched the last block.
> 
> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> ---
> [diffstat]
>  io_u.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/io_u.c
> +++ b/io_u.c
> @@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct
>  
>  		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
>  
> -		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
> +		*b = lastb * (r / ((uint64_t) rmax + 1.0));
>  	} else {
>  		uint64_t off = 0;

Wont this generate lastb as the potentially last block? We want lastb-1
as the last one, otherwise the length of IO from it will be 0.

I might be missing something here.

-- 
Jens Axboe



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

* Re: [patch 8/9] fio: fix last block never being touched by random offsets
  2014-02-20 17:18 ` Jens Axboe
@ 2014-02-28 16:46   ` Peter Oberparleiter
  2014-02-28 17:07     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Oberparleiter @ 2014-02-28 16:46 UTC (permalink / raw)
  To: Jens Axboe, ehrhardt; +Cc: fio

On 20.02.2014 18:18, Jens Axboe wrote:
> On Thu, Feb 20 2014, ehrhardt@linux.vnet.ibm.com wrote:
>> *Resend with hopefully non mangled patches*
>> References: <20140220131958.965092001@linux.vnet.ibm.com>
>> Content-Disposition: inline; filename=fix_last_block.diff
>>
>> From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
>>
>> Fix the available range for random offsets which never touched the last block.
>>
>> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>> ---
>> [diffstat]
>>  io_u.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- a/io_u.c
>> +++ b/io_u.c
>> @@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct
>>  
>>  		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
>>  
>> -		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
>> +		*b = lastb * (r / ((uint64_t) rmax + 1.0));
>>  	} else {
>>  		uint64_t off = 0;
> 
> Wont this generate lastb as the potentially last block? We want lastb-1
> as the last one, otherwise the length of IO from it will be 0.
> 
> I might be missing something here.

I would expect that the last I/O would be at offset size-blocksize and
size blocksize. Consider this example test case that should generate 1
second of random reads with offsets 0 and 512:

[job]
filename=datafile
blocksize=512
size=1024
time_based
runtime=1
rw=randread
norandommap
write_iolog=/dev/stdout

Running it with FIO_VERSION = fio-2.1.5-44-ga1fc produces the following
result:

> fio job | grep datafile | sort | uniq
datafile add
datafile close
datafile open
datafile read 0 512

-> I/O is only generated for offset 0

Running it with the same version and the subject patch applied:

> fio job | grep datafile | sort | uniq
datafile add
datafile close
datafile open
datafile read 0 512
datafile read 512 512

-> Both offsets are covered

-- 
Peter Oberparleiter
Linux on System z Development - IBM Germany



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

* Re: [patch 8/9] fio: fix last block never being touched by random offsets
  2014-02-28 16:46   ` Peter Oberparleiter
@ 2014-02-28 17:07     ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2014-02-28 17:07 UTC (permalink / raw)
  To: Peter Oberparleiter, ehrhardt; +Cc: fio

On 2014-02-28 08:46, Peter Oberparleiter wrote:
> On 20.02.2014 18:18, Jens Axboe wrote:
>> On Thu, Feb 20 2014, ehrhardt@linux.vnet.ibm.com wrote:
>>> *Resend with hopefully non mangled patches*
>>> References: <20140220131958.965092001@linux.vnet.ibm.com>
>>> Content-Disposition: inline; filename=fix_last_block.diff
>>>
>>> From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
>>>
>>> Fix the available range for random offsets which never touched the last block.
>>>
>>> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>>> ---
>>> [diffstat]
>>>   io_u.c |    2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> --- a/io_u.c
>>> +++ b/io_u.c
>>> @@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct
>>>
>>>   		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
>>>
>>> -		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
>>> +		*b = lastb * (r / ((uint64_t) rmax + 1.0));
>>>   	} else {
>>>   		uint64_t off = 0;
>>
>> Wont this generate lastb as the potentially last block? We want lastb-1
>> as the last one, otherwise the length of IO from it will be 0.
>>
>> I might be missing something here.
>
> I would expect that the last I/O would be at offset size-blocksize and
> size blocksize. Consider this example test case that should generate 1
> second of random reads with offsets 0 and 512:
>
> [job]
> filename=datafile
> blocksize=512
> size=1024
> time_based
> runtime=1
> rw=randread
> norandommap
> write_iolog=/dev/stdout
>
> Running it with FIO_VERSION = fio-2.1.5-44-ga1fc produces the following
> result:
>
>> fio job | grep datafile | sort | uniq
> datafile add
> datafile close
> datafile open
> datafile read 0 512
>
> -> I/O is only generated for offset 0
>
> Running it with the same version and the subject patch applied:
>
>> fio job | grep datafile | sort | uniq
> datafile add
> datafile close
> datafile open
> datafile read 0 512
> datafile read 512 512
>
> -> Both offsets are covered

Tested here, and it does look correct. Thanks, I will apply it.

-- 
Jens Axboe



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

* [patch 8/9] fio: fix last block never being touched by random offsets
       [not found] <20140219143639.168501090@linux.vnet.ibm.com>
@ 2014-02-19 15:12 ` Christian Ehrhardt
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Ehrhardt @ 2014-02-19 15:12 UTC (permalink / raw)
  To: fio; +Cc: oberpar, Christian Ehrhardt

From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>

Fix the available range for random offsets which never touched the last 
block.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
  io_u.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

--- a/io_u.c
+++ b/io_u.c
@@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct
   		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
  -		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
+		*b = lastb * (r / ((uint64_t) rmax + 1.0));
  	} else {
  		uint64_t off = 0;



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

end of thread, other threads:[~2014-02-28 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 13:20 [patch 8/9] fio: fix last block never being touched by random offsets ehrhardt
2014-02-20 17:18 ` Jens Axboe
2014-02-28 16:46   ` Peter Oberparleiter
2014-02-28 17:07     ` Jens Axboe
     [not found] <20140219143639.168501090@linux.vnet.ibm.com>
2014-02-19 15:12 ` Christian Ehrhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.