Discussion:
vmcore cant be generated under kernel 4.7.9
R Sun
2016-11-12 03:02:57 UTC
Permalink
Hello,

I updated my fedora23 from 4.5.7-202 to 4.7.9-100 recently, and found out kdump
could not generate vmcore when crashed, but its ok with
vmcore-dmesg.txt. i traced
it for a while and find out its because of a change in the page struct
which _count renamed to _refcount committed as 0139aa7b7f in kernel.

Below is my patch to fix this problem

diff --git a/makedumpfile.c b/makedumpfile.c
index 853b999..1bfafb7 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2492,6 +2492,13 @@ read_vmcoreinfo(void)

READ_MEMBER_OFFSET("page.flags", page.flags);
READ_MEMBER_OFFSET("page._count", page._count);
+ /*
+ * _count, field of struct page, renamed to _refcount according to
+ * commit 0139aa7b7f in kernel. so just try page._refcount if
+ * page._count does not work
+ */
+ if (OFFSET(page._count) == NOT_FOUND_STRUCTURE)
+ READ_MEMBER_OFFSET("page._refcount", page._count);
READ_MEMBER_OFFSET("page.mapping", page.mapping);
READ_MEMBER_OFFSET("page.lru", page.lru);
READ_MEMBER_OFFSET("page._mapcount", page._mapcount);
Atsushi Kumagai
2016-11-14 04:29:05 UTC
Permalink
Hello,
Post by R Sun
Hello,
I updated my fedora23 from 4.5.7-202 to 4.7.9-100 recently, and found out kdump
could not generate vmcore when crashed, but its ok with
vmcore-dmesg.txt. i traced
it for a while and find out its because of a change in the page struct
which _count renamed to _refcount committed as 0139aa7b7f in kernel.
Below is my patch to fix this problem
Thanks for your report, this problem is going to be fixed in v1.6.1
by the patch below, it can be found in the devel branch.

https://sourceforge.net/p/makedumpfile/code/ci/devel/tree/

commit ed46b6ad90d71ca98aced9e82b67333ce1962ebf
Author: Vitaly Kuznetsov <***@redhat.com>
Date: Fri Jun 17 18:41:26 2016 +0900

[PATCH v2] Support _count -> _refcount rename in struct page

* Required for kernel 4.7

_count member was renamed to _refcount in linux commit 0139aa7b7fa12
("mm: rename _count, field of the struct page, to _refcount") and this
broke makedumpfile. The reason for making the change was to find all users
accessing it directly and not through the recommended API. I tried
suggesting to revert the change but failed, I see no other choice than to
start supporting both _count and _refcount in makedumpfile.

Signed-off-by: Vitaly Kuznetsov <***@redhat.com>


I'll try to release the next version in this month, please wait for a while.


Thanks,
Atsushi Kumagai
Post by R Sun
diff --git a/makedumpfile.c b/makedumpfile.c
index 853b999..1bfafb7 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2492,6 +2492,13 @@ read_vmcoreinfo(void)
READ_MEMBER_OFFSET("page.flags", page.flags);
READ_MEMBER_OFFSET("page._count", page._count);
+ /*
+ * _count, field of struct page, renamed to _refcount according to
+ * commit 0139aa7b7f in kernel. so just try page._refcount if
+ * page._count does not work
+ */
+ if (OFFSET(page._count) == NOT_FOUND_STRUCTURE)
+ READ_MEMBER_OFFSET("page._refcount", page._count);
READ_MEMBER_OFFSET("page.mapping", page.mapping);
READ_MEMBER_OFFSET("page.lru", page.lru);
READ_MEMBER_OFFSET("page._mapcount", page._mapcount);
Dave Young
2016-11-14 05:46:28 UTC
Permalink
Post by R Sun
Hello,
I updated my fedora23 from 4.5.7-202 to 4.7.9-100 recently, and found out kdump
could not generate vmcore when crashed, but its ok with
vmcore-dmesg.txt. i traced
it for a while and find out its because of a change in the page struct
which _count renamed to _refcount committed as 0139aa7b7f in kernel.
The makedumpfile patch has been in Fedora rawhide and F25 kexec-tools
patckage. I think you can use the rawhide rpm on F23

Thanks
Dave
Post by R Sun
Below is my patch to fix this problem
diff --git a/makedumpfile.c b/makedumpfile.c
index 853b999..1bfafb7 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2492,6 +2492,13 @@ read_vmcoreinfo(void)
READ_MEMBER_OFFSET("page.flags", page.flags);
READ_MEMBER_OFFSET("page._count", page._count);
+ /*
+ * _count, field of struct page, renamed to _refcount according to
+ * commit 0139aa7b7f in kernel. so just try page._refcount if
+ * page._count does not work
+ */
+ if (OFFSET(page._count) == NOT_FOUND_STRUCTURE)
+ READ_MEMBER_OFFSET("page._refcount", page._count);
READ_MEMBER_OFFSET("page.mapping", page.mapping);
READ_MEMBER_OFFSET("page.lru", page.lru);
READ_MEMBER_OFFSET("page._mapcount", page._mapcount);
_______________________________________________
kexec mailing list
http://lists.infradead.org/mailman/listinfo/kexec
Loading...