Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Yufei Ren <yufei.ren@stonybrook.edu>
Cc: fio@vger.kernel.org, Yufei Ren <renyufei83@gmail.com>
Subject: Re: [PATCH 2/4] thread cpu resource statistics bug fix
Date: Mon, 22 Oct 2012 10:04:14 +0200	[thread overview]
Message-ID: <5084FDFE.20208@kernel.dk> (raw)
In-Reply-To: <1350702712-5168-3-git-send-email-yufei.ren@stonybrook.edu>

On 2012-10-20 05:11, Yufei Ren wrote:
> From: Yufei Ren <renyufei83@gmail.com>
> 
> If `thread' option is enabled, resource usage should be thread
> based instead of process based. For the following job,
> 
> fio --ioengine=cpuio --cpuload=50 --time_based --runtime=10 --name=j0 --numjobs=4 --thread
> 
> before patch, each thread CPU statistics:
> ...
>   cpu          : usr=199.67%, sys=0.14%, ctx=1475, majf=0, minf=24
> ...
> 
> after patch:
> ...
>   cpu          : usr=49.80%, sys=0.00%, ctx=79, majf=0, minf=18446744073709538943
> ...
> ---
>  os/os-linux.h |    5 +++++
>  stat.c        |    4 ++++
>  2 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/os/os-linux.h b/os/os-linux.h
> index 9b7ff29..2b35f34 100644
> --- a/os/os-linux.h
> +++ b/os/os-linux.h
> @@ -14,6 +14,7 @@
>  #include <linux/unistd.h>
>  #include <linux/raw.h>
>  #include <linux/major.h>
> +#include <linux/version.h>
>  #include <endian.h>
>  
>  #include "indirect.h"
> @@ -62,6 +63,10 @@
>  #define FIO_HAVE_FALLOC_ENG
>  #endif
>  
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
> +#define FIO_HAVE_RUSAGE_THREAD
> +#endif

I applied this, but I wonder if we should not just make this dependent
on

#ifdef RUSAGE_THREAD
...
#endif

instead?

-- 
Jens Axboe


  reply	other threads:[~2012-10-22  8:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-20  3:11 [PATCH 0/4] FIO libnuma integration and 3 patches Yufei Ren
2012-10-20  3:11 ` [PATCH 1/4] cpuio engine cpuload bug fix Yufei Ren
2012-10-22  8:03   ` Jens Axboe
2012-10-20  3:11 ` [PATCH 2/4] thread cpu resource statistics " Yufei Ren
2012-10-22  8:04   ` Jens Axboe [this message]
2012-10-22 16:33     ` Yufei Ren
2012-10-22 17:10       ` Jens Axboe
2012-10-20  3:11 ` [PATCH 3/4] rdma ioengine improvement Yufei Ren
2012-10-22  8:06   ` Jens Axboe
2012-10-22 18:39     ` Yufei Ren
2012-10-20  3:11 ` [PATCH 4/4] Fine-grained job level numa control Yufei Ren
2012-10-22  8:07   ` Jens Axboe

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=5084FDFE.20208@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=renyufei83@gmail.com \
    --cc=yufei.ren@stonybrook.edu \
    /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