<br><br><div class="gmail_quote">2012/6/4 Atsushi Kumagai <span dir="ltr"><<a href="mailto:kumagai-atsushi@mxc.nes.nec.co.jp" target="_blank">kumagai-atsushi@mxc.nes.nec.co.jp</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Maxim,<br>
<div class="im"><br>
On Thu, 31 May 2012 10:50:39 +0400<br>
Maxim Uvarov <<a href="mailto:muvarov@gmail.com">muvarov@gmail.com</a>> wrote:<br>
<br>
> Atsushi,<br>
><br>
> do you have speed measurements for saving vmcore with this patches and<br>
> without them?<br>
> How much is speed up?<br>
><br>
> Thanks,<br>
> Maxim.<br>
<br>
</div>After received your mail, I measured executing time with the patch below.<br>
The result below was measured in 5GB memory machine.<br>
<br>
Result:<br>
  a. makedumpfile -Kcd31<br>
    excluding time:   6.55 [sec]<br>
    writing time:     5.89 [sec]<br>
<br>
  b. makedumpfile -cd31<br>
    excluding time:   0.21 [sec]<br>
    writing time:     5.82 [sec]<br>
<br>
I don't think this result is good, the prototype has some points to be<br>
improved for performance.<br>
(e.g. buffer size, the way to exclude free pages, etc...)<br>
<br>
However, I think getting a bit of speed down can't be helped to keep<br>
memory consumption.<br>
<br></blockquote><div><br>I'm asking because I have machines with several TBs of ram. And filtering and saving data from vmcore takes long time. (more then 30 minutes). I wonder if somebody already work on performance. Probably we can do SMP optimizations.<br>
<br>Maxim.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks<br>
Atsushi Kumagai<br>
<br>
<br>
>From 56e807066b333e3ef26afe8745deab8c952b5ca6 Mon Sep 17 00:00:00 2001<br>
From: Atsushi Kumagai <<a href="mailto:kumagai-atsushi@mxc.nes.nec.co.jp">kumagai-atsushi@mxc.nes.nec.co.jp</a>><br>
Date: Mon, 4 Jun 2012 10:15:50 +0900<br>
Subject: [PATCH] [RFC PATCH] Add time report for cyclic processing.<br>
<br>
Signed-off-by: Atsushi Kumagai <<a href="mailto:kumagai-atsushi@mxc.nes.nec.co.jp">kumagai-atsushi@mxc.nes.nec.co.jp</a>><br>
---<br>
 makedumpfile.c |   25 +++++++++++++++++++++++++<br>
 makedumpfile.h |   11 +++++++++++<br>
 2 files changed, 36 insertions(+)<br>
<br>
diff --git a/makedumpfile.c b/makedumpfile.c<br>
index f4b6f83..a211a89 100644<br>
--- a/makedumpfile.c<br>
+++ b/makedumpfile.c<br>
@@ -45,6 +45,9 @@ unsigned long long pfn_user;<br>
 unsigned long long pfn_free;<br>
 unsigned long long num_dumped;<br>
<br>
+double d_exclude_start, d_exclude_end, d_exclude_time;<br>
+double d_write_start, d_write_end, d_write_time;<br>
+<br>
 int retcd = FAILED;    /* return code */<br>
<br>
 #define INITIALIZE_LONG_TABLE(table, value) \<br>
@@ -4078,10 +4081,13 @@ create_dump_bitmap(void)<br>
        } else {<br>
                if (!prepare_bitmap_buffer())<br>
                        goto out;<br>
+               d_exclude_start = getdtime();<br>
                if (!create_1st_bitmap())<br>
                        goto out;<br>
                if (!create_2nd_bitmap())<br>
                        goto out;<br>
+               d_exclude_end = getdtime();<br>
+               d_exclude_time += d_exclude_end - d_exclude_start;<br>
        }<br>
<br>
        ret = TRUE;<br>
@@ -5500,12 +5506,15 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d<br>
        /*<br>
         * Get number of dumpable pages.<br>
         */<br>
+       d_exclude_start = getdtime();<br>
        for (info->split_start_pfn = 0, info->split_end_pfn = PFN_CYCLIC;<br>
             info->split_end_pfn <= info->max_mapnr;<br>
             info->split_start_pfn += PFN_CYCLIC, info->split_end_pfn += PFN_CYCLIC) {<br>
<br>
                info->num_dumpable += get_num_dumpable_cyclic();<br>
        }<br>
+       d_exclude_end = getdtime();<br>
+       d_exclude_time += d_exclude_end - d_exclude_start;<br>
<br>
        /*<br>
         * Reset counter for debug message.<br>
@@ -5540,26 +5549,35 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d<br>
             info->split_end_pfn <= info->max_mapnr;<br>
             info->split_start_pfn += PFN_CYCLIC, info->split_end_pfn += PFN_CYCLIC) {<br>
<br>
+               d_exclude_start = getdtime();<br>
                if (!create_1st_bitmap_cyclic())<br>
                        return FALSE;<br>
<br>
                if (!exclude_unnecessary_pages_cyclic())<br>
                        return FALSE;<br>
+               d_exclude_end = getdtime();<br>
+               d_exclude_time += d_exclude_end - d_exclude_start;<br>
<br>
+               d_write_start = getdtime();<br>
                if (!write_kdump_pages_cyclic(cd_header, cd_page, &pd_zero, &offset_data))<br>
                        return FALSE;<br>
<br>
                if (!write_kdump_bitmap_cyclic())<br>
                        return FALSE;<br>
+               d_write_end = getdtime();<br>
+               d_write_time += d_write_end - d_write_start;<br>
        }<br>
<br>
        /*<br>
         * Write the remainder.<br>
         */<br>
+       d_write_start = getdtime();<br>
        if (!write_cache_bufsz(cd_page))<br>
                return FALSE;<br>
        if (!write_cache_bufsz(cd_header))<br>
                return FALSE;<br>
+       d_write_end = getdtime();<br>
+       d_write_time += d_write_end - d_write_start;<br>
<br>
        return TRUE;<br>
 }<br>
@@ -6310,6 +6328,10 @@ print_report(void)<br>
        REPORT_MSG("--------------------------------------------------\n");<br>
        REPORT_MSG("Total pages     : 0x%016llx\n", info->max_mapnr);<br>
        REPORT_MSG("\n");<br>
+<br>
+       MSG("\n");<br>
+       MSG("excluding time  %lf [sec]\n", d_exclude_time);<br>
+       MSG("writing time: %lf [sec]\n", d_write_time);<br>
 }<br>
<br>
 int<br>
@@ -6349,10 +6371,13 @@ writeout_dumpfile(void)<br>
                if (!write_kdump_eraseinfo(&cd_page))<br>
                        goto out;<br>
        } else {<br>
+               d_write_start = getdtime();<br>
                if (!write_kdump_header())<br>
                        goto out;<br>
                if (!write_kdump_pages(&cd_header, &cd_page))<br>
                        goto out;<br>
+               d_write_end = getdtime();<br>
+               d_write_time = d_write_end - d_write_start;<br>
                if (!write_kdump_eraseinfo(&cd_page))<br>
                        goto out;<br>
                if (!write_kdump_bitmap())<br>
diff --git a/makedumpfile.h b/makedumpfile.h<br>
index a8aab2a..ca9b100 100644<br>
--- a/makedumpfile.h<br>
+++ b/makedumpfile.h<br>
@@ -16,6 +16,7 @@<br>
 #ifndef _MAKEDUMPFILE_H<br>
 #define _MAKEDUMPFILE_H<br>
<br>
+#include <sys/time.h><br>
 #include <stdio.h><br>
 #include <stdlib.h><br>
 #include <fcntl.h><br>
@@ -1502,4 +1503,14 @@ struct elf_prstatus {<br>
<br>
 #endif<br>
<br>
+static inline double<br>
+getdtime(void)<br>
+{<br>
+       struct timeval tv;<br>
+<br>
+       gettimeofday(&tv, NULL);<br>
+<br>
+       return (double)tv.tv_sec + (double)tv.tv_usec * 0.001 * 0.001;<br>
+}<br>
+<br>
 #endif /* MAKEDUMPFILE_H */<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.2<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Maxim Uvarov<br>