x86: add code to dump the (kernel) page tables for visual inspection
PATCH 1/1 x86: add code to dump the (kernel) page tables for visual inspection
Subject: x86: add code to dump the (kernel) page tables for visual inspection by kernel developers
From: Arjan van de Ven <[email protected]>
This patch adds code to the kernel to have an (optional) /proc/kernel_page_tables debug file that basically dumps the kernel pagetables; this allows us kernel developers to verify that nothing fishy is going on and that the various mappings are set up correctly. This was quite useful in finding various change_page_attr() bugs, and is very likely to be useful in the future as well.
--- arch/x86/Kconfig.debug | 11 + arch/x86/mm/Makefile_64 | 1 arch/x86/mm/dump_pagetables.c | 301 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 313 insertions(+)
arch/x86/Kconfig.debug +11 -0
@@ -70,6 +70,17 @@ config DEBUG_PER_CPU_MAPS Say N if unsure. +config X86_PTDUMP + bool "Export kernel pagetable layout to userspace in /proc" + depends on X86_64 + help + Say Y here if you want to show the kernel pagetable layout in + a /proc file. This information is only useful for kernel developers + who are working in architecture specific areas of the kernel. + It is probably not a good idea to enable this feature in a production + kernel. + If in doubt, say "N" + config DEBUG_RODATA bool "Write protect kernel read-only data structures" default y
arch/x86/mm/Makefile_64 +1 -0
@@ -7,3 +7,4 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpag obj-$(CONFIG_NUMA) += numa_64.o obj-$(CONFIG_K8_NUMA) += k8topology_64.o obj-$(CONFIG_ACPI_NUMA) += srat_64.o +obj-$(CONFIG_X86_PTDUMP) += dump_pagetables.o
arch/x86/mm/dump_pagetables.c new file +301 -0
301 lines not on this page · raw message
Signature · 3 lines
If you want to reach me at my work email, use [email protected] For development, discussion and tips for power savings, visit http://www.lesswatts.org
Quoted 10 lines · Arjan van de Ven
Subject: x86: add code to dump the (kernel) page tables for visual inspection by kernel developers
From: Arjan van de Ven <[email protected]>This patch adds code to the kernel to have an (optional)
/proc/kernel_page_tablesdebug file that basically dumps the kernel pagetables; this allows us kernel developers to verify that nothing fishy is going on and that the various mappings are set up correctly. This was quite useful in finding variouschange_page_attr()bugs, and is very likely to be useful in the future as well.
Seems nice Arjan, but could we also add NUMA information ?
Quoted 14 lines · On Tue, 05 Feb 2008 21:46:52 +0100 Eric Dumazet <[email protected]> wrote:
Quoted 4 lines · Arjan van de Ven
Subject: x86: add code to dump the (kernel) page tables for visual inspection by kernel developers From: Arjan van de Ven <[email protected]>
Quoted 8 lines
This patch adds code to the kernel to have an (optional)
/proc/kernel_page_tablesdebug file that basically dumps the kernel pagetables; this allows us kernel developers to verify that nothing fishy is going on and that the various mappings are set up correctly. This was quite useful in finding variouschange_page_attr()bugs, and is very likely to be useful in the future as well.
Quoted 2 lines
Seems nice Arjan, but could we also add NUMA information ?
ok maybe I'm missing something, but the kernel VA space currently
is totally not numa dependent in any shape or form...
so can you explain what kind of information you're looking for?
(I guess I just don't really understand your request; can you expand a bit on it?)
Signature · 3 lines
If you want to reach me at my work email, use [email protected] For development, discussion and tips for power savings, visit http://www.lesswatts.org
Quoted 5 lines · Arjan van de Ven
Subject: x86: add code to dump the (kernel) page tables for visual inspection by kernel developers
From: Arjan van de Ven <[email protected]>This patch adds code to the kernel to have an (optional)
/proc/kernel_page_tablesdebug file that basically dumps the kernel
'No new crap goes to /proc?'
It does not seem to be per process -> it should probably go to debugfs.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html