All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
@ 2011-05-02 14:02 ` Wu Fengguang
  0 siblings, 0 replies; 6+ messages in thread
From: Wu Fengguang @ 2011-05-02 14:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, Minchan Kim, Mel Gorman, Dave Young, linux-mm,
	Linux Kernel Mailing List, KAMEZAWA Hiroyuki, Christoph Lameter,
	Dave Chinner, David Rientjes

I find it very handy to show the average delays in milliseconds.

Example output (on 100 concurrent dd reading sparse files):

CPU             count     real total  virtual total    delay total  delay average
                  986     3223509952     3207643301    38863410579         39.415ms
IO              count    delay total  delay average
                    0              0              0ms
SWAP            count    delay total  delay average
                    0              0              0ms
RECLAIM         count    delay total  delay average
                 1059     5131834899              4ms
dd: read=0, write=0, cancelled_write=0

CC: Mel Gorman <mel@linux.vnet.ibm.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 Documentation/accounting/getdelays.c |   33 +++++++++++++++----------
 1 file changed, 20 insertions(+), 13 deletions(-)

--- linux-next.orig/Documentation/accounting/getdelays.c	2011-05-02 11:33:44.000000000 +0800
+++ linux-next/Documentation/accounting/getdelays.c	2011-05-02 21:36:45.000000000 +0800
@@ -191,30 +191,37 @@ static int get_family_id(int sd)
 	return id;
 }
 
+#define average_ms(t, c) (t / 1000000ULL / (c ? c : 1))
+
 static void print_delayacct(struct taskstats *t)
 {
-	printf("\n\nCPU   %15s%15s%15s%15s\n"
-	       "      %15llu%15llu%15llu%15llu\n"
-	       "IO    %15s%15s\n"
-	       "      %15llu%15llu\n"
-	       "SWAP  %15s%15s\n"
-	       "      %15llu%15llu\n"
-	       "RECLAIM  %12s%15s\n"
-	       "      %15llu%15llu\n",
-	       "count", "real total", "virtual total", "delay total",
+	printf("\n\nCPU   %15s%15s%15s%15s%15s\n"
+	       "      %15llu%15llu%15llu%15llu%15.3fms\n"
+	       "IO    %15s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n"
+	       "SWAP  %15s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n"
+	       "RECLAIM  %12s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n",
+	       "count", "real total", "virtual total",
+	       "delay total", "delay average",
 	       (unsigned long long)t->cpu_count,
 	       (unsigned long long)t->cpu_run_real_total,
 	       (unsigned long long)t->cpu_run_virtual_total,
 	       (unsigned long long)t->cpu_delay_total,
-	       "count", "delay total",
+	       average_ms((double)t->cpu_delay_total, t->cpu_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->blkio_count,
 	       (unsigned long long)t->blkio_delay_total,
-	       "count", "delay total",
+	       average_ms(t->blkio_delay_total, t->blkio_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->swapin_count,
 	       (unsigned long long)t->swapin_delay_total,
-	       "count", "delay total",
+	       average_ms(t->swapin_delay_total, t->swapin_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->freepages_count,
-	       (unsigned long long)t->freepages_delay_total);
+	       (unsigned long long)t->freepages_delay_total,
+	       average_ms(t->freepages_delay_total, t->freepages_count));
 }
 
 static void task_context_switch_counts(struct taskstats *t)

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

* [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
@ 2011-05-02 14:02 ` Wu Fengguang
  0 siblings, 0 replies; 6+ messages in thread
From: Wu Fengguang @ 2011-05-02 14:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, Minchan Kim, Mel Gorman, Dave Young, linux-mm,
	Linux Kernel Mailing List, KAMEZAWA Hiroyuki, Christoph Lameter,
	Dave Chinner, David Rientjes

I find it very handy to show the average delays in milliseconds.

Example output (on 100 concurrent dd reading sparse files):

CPU             count     real total  virtual total    delay total  delay average
                  986     3223509952     3207643301    38863410579         39.415ms
IO              count    delay total  delay average
                    0              0              0ms
SWAP            count    delay total  delay average
                    0              0              0ms
RECLAIM         count    delay total  delay average
                 1059     5131834899              4ms
dd: read=0, write=0, cancelled_write=0

CC: Mel Gorman <mel@linux.vnet.ibm.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 Documentation/accounting/getdelays.c |   33 +++++++++++++++----------
 1 file changed, 20 insertions(+), 13 deletions(-)

--- linux-next.orig/Documentation/accounting/getdelays.c	2011-05-02 11:33:44.000000000 +0800
+++ linux-next/Documentation/accounting/getdelays.c	2011-05-02 21:36:45.000000000 +0800
@@ -191,30 +191,37 @@ static int get_family_id(int sd)
 	return id;
 }
 
+#define average_ms(t, c) (t / 1000000ULL / (c ? c : 1))
+
 static void print_delayacct(struct taskstats *t)
 {
-	printf("\n\nCPU   %15s%15s%15s%15s\n"
-	       "      %15llu%15llu%15llu%15llu\n"
-	       "IO    %15s%15s\n"
-	       "      %15llu%15llu\n"
-	       "SWAP  %15s%15s\n"
-	       "      %15llu%15llu\n"
-	       "RECLAIM  %12s%15s\n"
-	       "      %15llu%15llu\n",
-	       "count", "real total", "virtual total", "delay total",
+	printf("\n\nCPU   %15s%15s%15s%15s%15s\n"
+	       "      %15llu%15llu%15llu%15llu%15.3fms\n"
+	       "IO    %15s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n"
+	       "SWAP  %15s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n"
+	       "RECLAIM  %12s%15s%15s\n"
+	       "      %15llu%15llu%15llums\n",
+	       "count", "real total", "virtual total",
+	       "delay total", "delay average",
 	       (unsigned long long)t->cpu_count,
 	       (unsigned long long)t->cpu_run_real_total,
 	       (unsigned long long)t->cpu_run_virtual_total,
 	       (unsigned long long)t->cpu_delay_total,
-	       "count", "delay total",
+	       average_ms((double)t->cpu_delay_total, t->cpu_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->blkio_count,
 	       (unsigned long long)t->blkio_delay_total,
-	       "count", "delay total",
+	       average_ms(t->blkio_delay_total, t->blkio_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->swapin_count,
 	       (unsigned long long)t->swapin_delay_total,
-	       "count", "delay total",
+	       average_ms(t->swapin_delay_total, t->swapin_count),
+	       "count", "delay total", "delay average",
 	       (unsigned long long)t->freepages_count,
-	       (unsigned long long)t->freepages_delay_total);
+	       (unsigned long long)t->freepages_delay_total,
+	       average_ms(t->freepages_delay_total, t->freepages_count));
 }
 
 static void task_context_switch_counts(struct taskstats *t)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* RE: [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
  2011-05-02 14:02 ` Wu Fengguang
@ 2011-05-05  3:37   ` Satoru Moriya
  -1 siblings, 0 replies; 6+ messages in thread
From: Satoru Moriya @ 2011-05-05  3:37 UTC (permalink / raw)
  To: Wu Fengguang, Andrew Morton
  Cc: KOSAKI Motohiro, Minchan Kim, Mel Gorman, Dave Young, linux-mm,
	Linux Kernel Mailing List, KAMEZAWA Hiroyuki, Christoph Lameter,
	Dave Chinner, David Rientjes

On 05/02/2011 10:02 AM, Wu Fengguang wrote: 
> I find it very handy to show the average delays in milliseconds.
> 
> Example output (on 100 concurrent dd reading sparse files):
> 
> CPU             count     real total  virtual total    delay total  delay average
>                   986     3223509952     3207643301    38863410579         39.415ms
> IO              count    delay total  delay average
>                     0              0              0ms
> SWAP            count    delay total  delay average
>                     0              0              0ms
> RECLAIM         count    delay total  delay average
>                  1059     5131834899              4ms
> dd: read=0, write=0, cancelled_write=0
> 
> CC: Mel Gorman <mel@linux.vnet.ibm.com>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>

This is useful for me.

Reviewed-by: Satoru Moriya <satoru.moriya@hds.com>


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

* RE: [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
@ 2011-05-05  3:37   ` Satoru Moriya
  0 siblings, 0 replies; 6+ messages in thread
From: Satoru Moriya @ 2011-05-05  3:37 UTC (permalink / raw)
  To: Wu Fengguang, Andrew Morton
  Cc: KOSAKI Motohiro, Minchan Kim, Mel Gorman, Dave Young, linux-mm,
	Linux Kernel Mailing List, KAMEZAWA Hiroyuki, Christoph Lameter,
	Dave Chinner, David Rientjes

On 05/02/2011 10:02 AM, Wu Fengguang wrote: 
> I find it very handy to show the average delays in milliseconds.
> 
> Example output (on 100 concurrent dd reading sparse files):
> 
> CPU             count     real total  virtual total    delay total  delay average
>                   986     3223509952     3207643301    38863410579         39.415ms
> IO              count    delay total  delay average
>                     0              0              0ms
> SWAP            count    delay total  delay average
>                     0              0              0ms
> RECLAIM         count    delay total  delay average
>                  1059     5131834899              4ms
> dd: read=0, write=0, cancelled_write=0
> 
> CC: Mel Gorman <mel@linux.vnet.ibm.com>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>

This is useful for me.

Reviewed-by: Satoru Moriya <satoru.moriya@hds.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
  2011-05-02 14:02 ` Wu Fengguang
@ 2011-05-09  5:40   ` KOSAKI Motohiro
  -1 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2011-05-09  5:40 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: kosaki.motohiro, Andrew Morton, Minchan Kim, Mel Gorman,
	Dave Young, linux-mm, Linux Kernel Mailing List,
	KAMEZAWA Hiroyuki, Christoph Lameter, Dave Chinner,
	David Rientjes

> I find it very handy to show the average delays in milliseconds.
> 
> Example output (on 100 concurrent dd reading sparse files):
> 
> CPU             count     real total  virtual total    delay total  delay average
>                   986     3223509952     3207643301    38863410579         39.415ms
> IO              count    delay total  delay average
>                     0              0              0ms
> SWAP            count    delay total  delay average
>                     0              0              0ms
> RECLAIM         count    delay total  delay average
>                  1059     5131834899              4ms
> dd: read=0, write=0, cancelled_write=0
> 
> CC: Mel Gorman <mel@linux.vnet.ibm.com>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  Documentation/accounting/getdelays.c |   33 +++++++++++++++----------
>  1 file changed, 20 insertions(+), 13 deletions(-)

Cool.
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>





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

* Re: [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays
@ 2011-05-09  5:40   ` KOSAKI Motohiro
  0 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2011-05-09  5:40 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: kosaki.motohiro, Andrew Morton, Minchan Kim, Mel Gorman,
	Dave Young, linux-mm, Linux Kernel Mailing List,
	KAMEZAWA Hiroyuki, Christoph Lameter, Dave Chinner,
	David Rientjes

> I find it very handy to show the average delays in milliseconds.
> 
> Example output (on 100 concurrent dd reading sparse files):
> 
> CPU             count     real total  virtual total    delay total  delay average
>                   986     3223509952     3207643301    38863410579         39.415ms
> IO              count    delay total  delay average
>                     0              0              0ms
> SWAP            count    delay total  delay average
>                     0              0              0ms
> RECLAIM         count    delay total  delay average
>                  1059     5131834899              4ms
> dd: read=0, write=0, cancelled_write=0
> 
> CC: Mel Gorman <mel@linux.vnet.ibm.com>
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  Documentation/accounting/getdelays.c |   33 +++++++++++++++----------
>  1 file changed, 20 insertions(+), 13 deletions(-)

Cool.
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>




--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-05-09  5:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-02 14:02 [PATCH] getdelays: show average CPU/IO/SWAP/RECLAIM delays Wu Fengguang
2011-05-02 14:02 ` Wu Fengguang
2011-05-05  3:37 ` Satoru Moriya
2011-05-05  3:37   ` Satoru Moriya
2011-05-09  5:40 ` KOSAKI Motohiro
2011-05-09  5:40   ` KOSAKI Motohiro

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.