From: Qiao Nuohan <[email protected]>

initialize_bitmap_memory_parallel and initialize_2nd_bitmap_parallel
is used for parallel process to avoid conflict on bitmap.

Signed-off-by: Qiao Nuohan <[email protected]>
---
 makedumpfile.c |   20 ++++++++++++++++++++
 makedumpfile.h |   18 ++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 8a69321..05859a3 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -3398,6 +3398,16 @@ initialize_bitmap_memory(void)
        return TRUE;
 }
 
+void
+initialize_bitmap_memory_parallel(struct dump_bitmap *bitmap, int thread_num)
+{
+       bitmap->fd = FD_BITMAP_MEMORY_PARALLEL(thread_num);
+       bitmap->file_name = info->name_memory;
+       bitmap->no_block = -1;
+       memset(bitmap->buf, 0, BUFSIZE_BITMAP);
+       bitmap->offset = info->bitmap_memory->offset;
+}
+
 int
 calibrate_machdep_info(void)
 {
@@ -3713,6 +3723,16 @@ initialize_2nd_bitmap(struct dump_bitmap *bitmap)
        bitmap->offset = info->len_bitmap / 2;
 }
 
+void
+initialize_2nd_bitmap_parallel(struct dump_bitmap *bitmap, int thread_num)
+{
+       bitmap->fd = FD_BITMAP_PARALLEL(thread_num);
+       bitmap->file_name = info->name_bitmap;
+       bitmap->no_block = -1;
+       memset(bitmap->buf, 0, BUFSIZE_BITMAP);
+       bitmap->offset = info->len_bitmap / 2;
+}
+
 int
 set_bitmap(struct dump_bitmap *bitmap, mdf_pfn_t pfn, int val)
 {
diff --git a/makedumpfile.h b/makedumpfile.h
index 939850f..b1ff561 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -429,6 +429,11 @@ do { \
 #define SPLITTING_SIZE_EI(i)   info->splitting_info[i].size_eraseinfo
 
 /*
+ * Macro for getting parallel info.
+ */
+#define FD_BITMAP_MEMORY_PARALLEL(i)   info->parallel_info[i].fd_bitmap_memory
+#define FD_BITMAP_PARALLEL(i)          info->parallel_info[i].fd_bitmap
+/*
  * kernel version
  *
  * NOTE: the format of kernel_version is as follows
@@ -957,6 +962,18 @@ struct splitting_info {
        unsigned long           size_eraseinfo;
 } splitting_info_t;
 
+struct parallel_info {
+       int                     fd_memory;
+       int                     fd_bitmap_memory;
+       int                     fd_bitmap;
+       unsigned char           *buf;
+       unsigned char           *buf_out;
+       struct mmap_cache       *mmap_cache;
+#ifdef USELZO
+       lzo_bytep               wrkmem;
+#endif
+} parallel_info_t;
+
 struct ppc64_vmemmap {
        unsigned long           phys;
        unsigned long           virt;
@@ -1093,6 +1110,7 @@ struct DumpInfo {
        char                    *name_dumpfile;
        int                     num_dumpfile;
        struct splitting_info   *splitting_info;
+       struct parallel_info    *parallel_info;
 
        /*
         * bitmap info:
-- 
1.7.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to