Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: fix wrong report time for copying data
@ 2014-01-14 10:49 HATAYAMA Daisuke
  2014-01-20  7:50 ` Atsushi Kumagai
  0 siblings, 1 reply; 2+ messages in thread
From: HATAYAMA Daisuke @ 2014-01-14 10:49 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: kexec@lists.infradead.org, Cliff Wickman

From 81c669484d6e38856f931af025e0d391abcdd168 Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Date: Fri, 10 Jan 2014 12:29:03 +0900
Subject: [PATCH] fix wrong report time for copying data

Currently, in cyclic mode, reported time for copying pages includes
the time consumed for 1) update cycles, 2) filtering memory, 3)
writing pages and 4) other things among the three. This is wrong. The
``copying pages'' should be ``3) writing pages'' only.

On the system with terabyte-scale memory, it requires several minutes
to process memory filtering. As a result, on such system, copying data
in cyclic mode looks several minutes slower than the actual.

This patch fixes this by counting times for ``3) writing pages'' only
as a time for ``copying pages.''

The output changes like below:

[before]

Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.124988 seconds
Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.142915 seconds
Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.024244 seconds
Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.118873 seconds
Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.142979 seconds
Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.024361 seconds
Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.118428 seconds
Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.143258 seconds
Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.024470 seconds
Copying data                       : [100.0 %] -STEP [Copying data               ] : 19.807846 seconds

[after]

Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.118851 seconds
Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.142766 seconds
Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.024204 seconds
Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.118849 seconds
Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.142812 seconds
Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.024394 seconds
Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.118293 seconds
Copying data                       : [ 25.6 %] |STEP [Copying data               ] : 4.343230 seconds
Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.143136 seconds
Copying data                       : [ 73.4 %] /STEP [Copying data               ] : 9.939977 seconds
Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.024642 seconds
Copying data                       : [100.0 %] -STEP [Copying data               ] : 4.844130 seconds
Copying data                       : [100.0 %] /STEP [Copying data               ] : 0.000093 seconds

So, you need to calculate a total time for copying data by yourself.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
---
 makedumpfile.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index ef08d91..32ad513 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -6331,6 +6331,7 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
 	struct page_desc pd;
 	unsigned char buf[info->page_size], *buf_out = NULL;
 	unsigned long len_buf_out;
+	struct timeval tv_start;
 	const off_t failed = (off_t)-1;
 	unsigned long len_buf_out_zlib, len_buf_out_lzo, len_buf_out_snappy;
 
@@ -6390,6 +6391,8 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
 			end_pfn = info->split_end_pfn;
 	}
 
+	gettimeofday(&tv_start, NULL);
+
 	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
 
 		if ((num_dumped % per) == 0)
@@ -6482,6 +6485,9 @@ out:
 		free(wrkmem);
 #endif
 
+	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable);
+	print_execution_time(PROGRESS_COPY, &tv_start);
+
 	return ret;
 }
 
@@ -6816,8 +6822,6 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
 	unsigned long long pfn;
 	struct timeval tv_start;
 
-	gettimeofday(&tv_start, NULL);
-
 	/*
 	 * Reset counter for debug message.
 	 */
@@ -6888,6 +6892,8 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
 			return FALSE;
         }
 
+	gettimeofday(&tv_start, NULL);
+
 	/*
 	 * Write the remainder.
 	 */
-- 
1.8.4.2

-- 
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] makedumpfile: fix wrong report time for copying data
  2014-01-14 10:49 [PATCH] makedumpfile: fix wrong report time for copying data HATAYAMA Daisuke
@ 2014-01-20  7:50 ` Atsushi Kumagai
  0 siblings, 0 replies; 2+ messages in thread
From: Atsushi Kumagai @ 2014-01-20  7:50 UTC (permalink / raw)
  To: HATAYAMA Daisuke; +Cc: kexec@lists.infradead.org, Cliff Wickman

On 2014/01/14 19:53:24, kexec <kexec-bounces@lists.infradead.org> wrote:
> From 81c669484d6e38856f931af025e0d391abcdd168 Mon Sep 17 00:00:00 2001
> From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
> Date: Fri, 10 Jan 2014 12:29:03 +0900
> Subject: [PATCH] fix wrong report time for copying data
>
> Currently, in cyclic mode, reported time for copying pages includes
> the time consumed for 1) update cycles, 2) filtering memory, 3)
> writing pages and 4) other things among the three. This is wrong. The
> ``copying pages'' should be ``3) writing pages'' only.
>
> On the system with terabyte-scale memory, it requires several minutes
> to process memory filtering. As a result, on such system, copying data
> in cyclic mode looks several minutes slower than the actual.
>
> This patch fixes this by counting times for ``3) writing pages'' only
> as a time for ``copying pages.''

write_elf_pages_cyclic() should be fixed too, but it's difficult to fix
it neatly because the ``3) writing pages'' sections are separated in it.
So I think I should clean it up before fix the report time issue if possible.

Anyway, I accept this patch as it is, thanks.


Atsushi Kumagai

> The output changes like below:
>
> [before]
>
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.124988 seconds
> Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.142915 seconds
> Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.024244 seconds
> Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.118873 seconds
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.142979 seconds
> Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.024361 seconds
> Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.118428 seconds
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.143258 seconds
> Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.024470 seconds
> Copying data                       : [100.0 %] -STEP [Copying data               ] : 19.807846 seconds
>
> [after]
> 
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.118851 seconds
> Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.142766 seconds
> Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.024204 seconds
> Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.118849 seconds
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.142812 seconds
> Excluding unnecessary pages        : [100.0 %] -STEP [Excluding unnecessary pages] : 0.024394 seconds
> Excluding unnecessary pages        : [100.0 %] /STEP [Excluding unnecessary pages] : 0.118293 seconds
> Copying data                       : [ 25.6 %] |STEP [Copying data               ] : 4.343230 seconds
> Excluding unnecessary pages        : [100.0 %] \STEP [Excluding unnecessary pages] : 0.143136 seconds
> Copying data                       : [ 73.4 %] /STEP [Copying data               ] : 9.939977 seconds
> Excluding unnecessary pages        : [100.0 %] |STEP [Excluding unnecessary pages] : 0.024642 seconds
> Copying data                       : [100.0 %] -STEP [Copying data               ] : 4.844130 seconds
> Copying data                       : [100.0 %] /STEP [Copying data               ] : 0.000093 seconds
> 
> So, you need to calculate a total time for copying data by yourself.
> 
> Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
> ---
>  makedumpfile.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/makedumpfile.c b/makedumpfile.c
> index ef08d91..32ad513 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -6331,6 +6331,7 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
>  	struct page_desc pd;
>  	unsigned char buf[info->page_size], *buf_out = NULL;
>  	unsigned long len_buf_out;
> +	struct timeval tv_start;
>  	const off_t failed = (off_t)-1;
>  	unsigned long len_buf_out_zlib, len_buf_out_lzo, len_buf_out_snappy;
>  
> @@ -6390,6 +6391,8 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
>  			end_pfn = info->split_end_pfn;
>  	}
>  
> +	gettimeofday(&tv_start, NULL);
> +
>  	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
>  
>  		if ((num_dumped % per) == 0)
> @@ -6482,6 +6485,9 @@ out:
>  		free(wrkmem);
>  #endif
>  
> +	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable);
> +	print_execution_time(PROGRESS_COPY, &tv_start);
> +
>  	return ret;
>  }
>  
> @@ -6816,8 +6822,6 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
>  	unsigned long long pfn;
>  	struct timeval tv_start;
>  
> -	gettimeofday(&tv_start, NULL);
> -
>  	/*
>  	 * Reset counter for debug message.
>  	 */
> @@ -6888,6 +6892,8 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
>  			return FALSE;
>          }
>  
> +	gettimeofday(&tv_start, NULL);
> +
>  	/*
>  	 * Write the remainder.
>  	 */
> -- 
> 1.8.4.2
> 
> -- 
> Thanks.
> HATAYAMA, Daisuke
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2014-01-20  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 10:49 [PATCH] makedumpfile: fix wrong report time for copying data HATAYAMA Daisuke
2014-01-20  7:50 ` Atsushi Kumagai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox