Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <jaxboe@fusionio.com>
To: Zheng Liu <gnehzuil@gmail.com>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>,
	Zheng Liu <wenqing.lz@taobao.com>, Yu-ju Hong <yjhong@google.com>
Subject: Re: [PATCH RESEND] Fix sum_stat() bug in group_reporting.
Date: Fri, 16 Sep 2011 08:19:14 +0200	[thread overview]
Message-ID: <4E72EA62.5080709@fusionio.com> (raw)
In-Reply-To: <1316145305-10492-1-git-send-email-gnehzuil@gmail.com>

On 2011-09-16 05:55, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> Write samples in io_stat does not be counted with rw=randread, vice versa.
> Then, in sum_stat() function, it will cause 0/0 in calculating mean and S,
> and 'nan' is printed. So it should return immediately when src->samples is
> equal to 0.
> 
> the error result is as follows:
>   write: io=8328.0KB, bw=1582.7KB/s, iops=395 , runt=  5262msec
>     clat (usec): min=58 , max=293353 , avg= -nan, stdev= -nan
>      lat (usec): min=59 , max=293353 , avg= -nan, stdev= -nan
>     bw (KB/s) : min=   92, max=  804, per=-nan%, avg= -nan, stdev= -nan
> 
> the configuration file used:
> 
> [global]
> direct=1
> ioengine=psync
> bs=4k
> filename=/dev/sdb1
> runtime=5
> group_reporting
> loops=50
> 
> [read]
> rw=randread
> numjobs=8
> 
> [write]
> rw=randwrite
> numjobs=8
> 
> CC: Jens Axboe <jaxboe@fusionio.com>
> CC: Yu-ju Hong <yjhong@google.com>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
>  stat.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/stat.c b/stat.c
> index d2cc775..3662fd9 100644
> --- a/stat.c
> +++ b/stat.c
> @@ -618,6 +618,9 @@ static void sum_stat(struct io_stat *dst, struct io_stat *src, int nr)
>  {
>  	double mean, S;
>  
> +	if (src->samples == 0)
> +		return;
> +
>  	dst->min_val = min(dst->min_val, src->min_val);
>  	dst->max_val = max(dst->max_val, src->max_val);

Looks good, applied. Thanks!

-- 
Jens Axboe


      reply	other threads:[~2011-09-16  6:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16  3:55 [PATCH RESEND] Fix sum_stat() bug in group_reporting Zheng Liu
2011-09-16  6:19 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E72EA62.5080709@fusionio.com \
    --to=jaxboe@fusionio.com \
    --cc=fio@vger.kernel.org \
    --cc=gnehzuil@gmail.com \
    --cc=wenqing.lz@taobao.com \
    --cc=yjhong@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox