* [patch] fix hung fio process with large I/O sizes and verify= option
@ 2018-09-28 21:27 Jeff Moyer
2018-09-30 9:35 ` Sitsofe Wheeler
2018-09-30 14:16 ` Jens Axboe
0 siblings, 2 replies; 4+ messages in thread
From: Jeff Moyer @ 2018-09-28 21:27 UTC (permalink / raw)
To: fio
Hi,
If you use a very large I/O size (1G in this instance), and also specify
the verify option, fio will hang, using up 100% cpu, for ever and ever.
The problem is that __fill_random_buf_percentage does math that
overflows the size of an unsigned int. Fixing that gets fio to
terminate as expected.
Here is the job file which showed the problem:
[global]
ioengine=dev-dax
direct=0
filename=/dev/dax0.0
verify=crc32c
bs=1G
[write]
rw=write
runtime=5
[read]
stonewall
rw=read
runtime=5
Reported-by: sujith_pandel@dell.com
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
diff --git a/lib/rand.c b/lib/rand.c
index 46ffe4fb..99846a8d 100644
--- a/lib/rand.c
+++ b/lib/rand.c
@@ -156,7 +156,7 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf,
/*
* Fill random chunk
*/
- this_len = (segment * (100 - percentage)) / 100;
+ this_len = ((unsigned long long)segment * (100 - percentage)) / 100;
if (this_len > len)
this_len = len;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] fix hung fio process with large I/O sizes and verify= option
2018-09-28 21:27 [patch] fix hung fio process with large I/O sizes and verify= option Jeff Moyer
@ 2018-09-30 9:35 ` Sitsofe Wheeler
2018-09-30 14:17 ` Jens Axboe
2018-09-30 14:16 ` Jens Axboe
1 sibling, 1 reply; 4+ messages in thread
From: Sitsofe Wheeler @ 2018-09-30 9:35 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio, jmoyer
I'm not sure if you've overlooked this one Jens so I'm re-mentioning it...
On Fri, 28 Sep 2018 at 22:31, Jeff Moyer <jmoyer@redhat.com> wrote:
>
> Hi,
>
> If you use a very large I/O size (1G in this instance), and also specify
> the verify option, fio will hang, using up 100% cpu, for ever and ever.
> The problem is that __fill_random_buf_percentage does math that
> overflows the size of an unsigned int. Fixing that gets fio to
> terminate as expected.
>
> Here is the job file which showed the problem:
>
> [global]
> ioengine=dev-dax
> direct=0
> filename=/dev/dax0.0
> verify=crc32c
> bs=1G
> [write]
> rw=write
> runtime=5
> [read]
> stonewall
> rw=read
> runtime=5
>
> Reported-by: sujith_pandel@dell.com
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/lib/rand.c b/lib/rand.c
> index 46ffe4fb..99846a8d 100644
> --- a/lib/rand.c
> +++ b/lib/rand.c
> @@ -156,7 +156,7 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf,
> /*
> * Fill random chunk
> */
> - this_len = (segment * (100 - percentage)) / 100;
> + this_len = ((unsigned long long)segment * (100 - percentage)) / 100;
> if (this_len > len)
> this_len = len;
>
--
Sitsofe | http://sucs.org/~sits/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] fix hung fio process with large I/O sizes and verify= option
2018-09-28 21:27 [patch] fix hung fio process with large I/O sizes and verify= option Jeff Moyer
2018-09-30 9:35 ` Sitsofe Wheeler
@ 2018-09-30 14:16 ` Jens Axboe
1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2018-09-30 14:16 UTC (permalink / raw)
To: Jeff Moyer, fio
On 9/28/18 3:27 PM, Jeff Moyer wrote:
> Hi,
>
> If you use a very large I/O size (1G in this instance), and also specify
> the verify option, fio will hang, using up 100% cpu, for ever and ever.
> The problem is that __fill_random_buf_percentage does math that
> overflows the size of an unsigned int. Fixing that gets fio to
> terminate as expected.
>
> Here is the job file which showed the problem:
>
> [global]
> ioengine=dev-dax
> direct=0
> filename=/dev/dax0.0
> verify=crc32c
> bs=1G
> [write]
> rw=write
> runtime=5
> [read]
> stonewall
> rw=read
> runtime=5
>
> Reported-by: sujith_pandel@dell.com
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
>
> diff --git a/lib/rand.c b/lib/rand.c
> index 46ffe4fb..99846a8d 100644
> --- a/lib/rand.c
> +++ b/lib/rand.c
> @@ -156,7 +156,7 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf,
> /*
> * Fill random chunk
> */
> - this_len = (segment * (100 - percentage)) / 100;
> + this_len = ((unsigned long long)segment * (100 - percentage)) / 100;
> if (this_len > len)
> this_len = len;
Thanks Jeff, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] fix hung fio process with large I/O sizes and verify= option
2018-09-30 9:35 ` Sitsofe Wheeler
@ 2018-09-30 14:17 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2018-09-30 14:17 UTC (permalink / raw)
To: Sitsofe Wheeler; +Cc: fio, jmoyer
On 9/30/18 3:35 AM, Sitsofe Wheeler wrote:
> I'm not sure if you've overlooked this one Jens so I'm re-mentioning it...
Thanks, now applied :)
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-30 14:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-28 21:27 [patch] fix hung fio process with large I/O sizes and verify= option Jeff Moyer
2018-09-30 9:35 ` Sitsofe Wheeler
2018-09-30 14:17 ` Jens Axboe
2018-09-30 14:16 ` Jens Axboe
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.