Skip to contentSkip to conversation

makedumpfile: when using refiltering, initialize bitmap1 from the kdump file's bitmap2

PATCH Superseded Pingfan Liu 2 participants 5 messages Jul 31, 2018 – Aug 3, 2018

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makedumpfile: when using refiltering, initialize bitmap1 from the kdump file's bitmap2

When refiltering on kdump format file, there is no info about pt_load[] for exclude_nodata_pages(), and also we can not expect more data than the kdump file can provide, hence this patch suggests to initialize the refiltered bitmap1 from the kdump file's bitmap2.

Note about the bug reported by the following ops:
makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore
makedumpfile --split -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
Excluding unnecessary pages : [100.0 %] \
readpage_kdump_compressed: pfn(9b) is excluded from /var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.
readmem: type_addr: 1, addr:9b000, size:4096
read_pfn: Can't get the page data.
writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
Copying data : [ 24.6 %] - eta: 2s
makedumpfile Failed.

---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
makedumpfile.c +5 -1
index 101fa7c..af24359 100644
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
Signature · 7 lines
2.7.4


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

Hi Pingfan,

Thank you for the patch.

Quoted 4 lines · Pingfan Liu

When refiltering on kdump format file, there is no info about pt_load[] for exclude_nodata_pages(), and also we can not expect more data than the kdump file can provide, hence this patch suggests to initialize the refiltered bitmap1 from the kdump file's bitmap2.

I understood the issue (I don't have any vmcore which can reproduce it, though), but since the bitmap1 is written to the refiltered dump file, I think that we should not change the meaning of bitmap1 if possible, which is "a page on memory hole".

For instance, with the patch, crash using the bitmaps prints a different message for the same "excluded" paddr:

-read_diskdump: PAGE_EXCLUDED: paddr/pfn: 2613e130/2613e +read_diskdump: SEEK_ERROR: paddr/pfn: 2613e130/2613e !page_is_ram

and makedumpfile's -e option using the bitmap1 cannot be utilized when refiltering, these are not favorable.

So how about initializing the refiltered *bitmap2* from the kdump file's bitmap2 ? I'm checking if this works.

Thanks,
Kazu

Quoted 44 lines

Note about the bug reported by the following ops:
makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore
makedumpfile --split -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
Excluding unnecessary pages : [100.0 %] \
readpage_kdump_compressed: pfn(9b) is excluded from /var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.
readmem: type_addr: 1, addr:9b000, size:4096
read_pfn: Can't get the page data.
writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
Copying data : [ 24.6 %] - eta: 2s
makedumpfile Failed.

---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
makedumpfile.c +5 -2
index 101fa7c..af24359 100644
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
--
Quoted 2 lines

2.7.4

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

author
#2 lore raw
Quoted 18 lines · Kazuhito Hagio

Hi Pingfan,

Thank you for the patch.

Quoted 4 lines · Pingfan Liu

When refiltering on kdump format file, there is no info about pt_load[] for exclude_nodata_pages(), and also we can not expect more data than the kdump file can provide, hence this patch suggests to initialize the refiltered bitmap1 from the kdump file's bitmap2.

I understood the issue (I don't have any vmcore which can reproduce it, though), but since the bitmap1 is written to the refiltered dump file, I think that we should not change the meaning of bitmap1 if possible, which is "a page on memory hole".

For instance, with the patch, crash using the bitmaps prints a different message for the same "excluded" paddr:

Quoted 9 lines

-read_diskdump: PAGE_EXCLUDED: paddr/pfn: 2613e130/2613e +read_diskdump: SEEK_ERROR: paddr/pfn: 2613e130/2613e !page_is_ram

and makedumpfile's -e option using the bitmap1 cannot be utilized when refiltering, these are not favorable.

So how about initializing the refiltered *bitmap2* from the kdump file's bitmap2 ? I'm checking if this works.

Yes, it sounds a good idea.

Thanks,
Pingfan

Quoted 44 lines

Thanks,
Kazu

Quoted 41 lines

Note about the bug reported by the following ops:
makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore
makedumpfile --split -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
Excluding unnecessary pages : [100.0 %] \
readpage_kdump_compressed: pfn(9b) is excluded from /var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.
readmem: type_addr: 1, addr:9b000, size:4096
read_pfn: Can't get the page data.
writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
Copying data : [ 24.6 %] - eta: 2s
makedumpfile Failed.

---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
makedumpfile.c +5 -1
index 101fa7c..af24359 100644
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
Quoted 13 lines
Quoted 5 lines
makedumpfile.c +0 -1
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
--

2.7.4

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

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

#3 lore raw
Quoted 24 lines · piliu
Quoted 21 lines · Kazuhito Hagio

Hi Pingfan,

Thank you for the patch.

Quoted 4 lines · Pingfan Liu

When refiltering on kdump format file, there is no info about pt_load[] for exclude_nodata_pages(), and also we can not expect more data than the kdump file can provide, hence this patch suggests to initialize the refiltered bitmap1 from the kdump file's bitmap2.

I understood the issue (I don't have any vmcore which can reproduce it, though), but since the bitmap1 is written to the refiltered dump file, I think that we should not change the meaning of bitmap1 if possible, which is "a page on memory hole".

For instance, with the patch, crash using the bitmaps prints a different message for the same "excluded" paddr:

-read_diskdump: PAGE_EXCLUDED: paddr/pfn: 2613e130/2613e +read_diskdump: SEEK_ERROR: paddr/pfn: 2613e130/2613e !page_is_ram

Quoted 7 lines
Quoted 6 lines

and makedumpfile's -e option using the bitmap1 cannot be utilized when refiltering, these are not favorable.

So how about initializing the refiltered *bitmap2* from the kdump file's bitmap2 ? I'm checking if this works.

Yes, it sounds a good idea.

OK, as far as I've looked into it, this way looks good. Can you modify the patch?

Thanks,
Kazu

Quoted 63 lines

Thanks,
Pingfan

Quoted 10 lines

Thanks,
Kazu

Quoted 7 lines

Note about the bug reported by the following ops:
makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore makedumpfile --split -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
Excluding unnecessary pages : [100.0 %] \
readpage_kdump_compressed: pfn(9b) is excluded from

/var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.

Quoted 34 lines
Quoted 34 lines

readmem: type_addr: 1, addr:9b000, size:4096
read_pfn: Can't get the page data.
writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
Copying data : [ 24.6 %] - eta: 2s
makedumpfile Failed.

---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
makedumpfile.c +5 -1
index 101fa7c..af24359 100644
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
Quoted 13 lines
Quoted 5 lines
makedumpfile.c +0 -1
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
--

2.7.4

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

Quoted 4 lines

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

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

author
#4 lore raw
Quoted 28 lines · Kazuhito Hagio
Quoted 27 lines · piliu
Quoted 24 lines · Kazuhito Hagio

Hi Pingfan,

Thank you for the patch.

Quoted 4 lines · Pingfan Liu

When refiltering on kdump format file, there is no info about pt_load[] for exclude_nodata_pages(), and also we can not expect more data than the kdump file can provide, hence this patch suggests to initialize the refiltered bitmap1 from the kdump file's bitmap2.

I understood the issue (I don't have any vmcore which can reproduce it, though), but since the bitmap1 is written to the refiltered dump file, I think that we should not change the meaning of bitmap1 if possible, which is "a page on memory hole".

For instance, with the patch, crash using the bitmaps prints a different message for the same "excluded" paddr:

-read_diskdump: PAGE_EXCLUDED: paddr/pfn: 2613e130/2613e +read_diskdump: SEEK_ERROR: paddr/pfn: 2613e130/2613e !page_is_ram

and makedumpfile's -e option using the bitmap1 cannot be utilized when refiltering, these are not favorable.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

So how about initializing the refiltered *bitmap2* from the kdump file's bitmap2 ? I'm checking if this works.

Yes, it sounds a good idea.

OK, as far as I've looked into it, this way looks good. Can you modify the patch?

OK, will send out V2 soon

Thanks,
Pingfan

Quoted 64 lines
Quoted 64 lines

Thanks,
Pingfan

Quoted 10 lines

Thanks,
Kazu

Quoted 7 lines

Note about the bug reported by the following ops:
makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore makedumpfile --split -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
Excluding unnecessary pages : [100.0 %] \
readpage_kdump_compressed: pfn(9b) is excluded from

/var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.

Quoted 47 lines
Quoted 37 lines

readmem: type_addr: 1, addr:9b000, size:4096
read_pfn: Can't get the page data.
writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
Copying data : [ 24.6 %] - eta: 2s
makedumpfile Failed.

---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
makedumpfile.c +5 -2
index 101fa7c..af24359 100644
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
--
Quoted 2 lines

2.7.4

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

Quoted 6 lines
Quoted 4 lines

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

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