x86: copy_oldmem_page using cached addressing
Subsystems (3)
PATCH 1/1 x86: copy_oldmem_page using cached addressing
From: Cliff Wickman <[email protected]>
The copy of /proc/vmcore to a user buffer proceeds much faster if the kernel addresses memory as cached.
With this patch we have seen an increase in transfer rate from less than 15MB/s to 80-460MB/s, depending on size of the transfer. This makes a big difference in time needed to save a system dump.
(Does anyone know of a reason why copy_oldmem_page() would need
to use uncached addresses?)
Diffed against 2.6.36-rc3
--- arch/x86/kernel/crash_dump_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/crash_dump_64.c +1 -1
@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pif (!csize)return 0 ; - vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); + vaddr =ioremap_cache (pfn <<PAGE_SHIFT ,PAGE_SIZE );if (!vaddr)return -ENOMEM ;
Quoted 5 lines · Cliff Wickman
From: Cliff Wickman <[email protected]>
The copy of
/proc/vmcoreto a user buffer proceeds much faster if the kernel addresses memory as cached.
Quoted 8 lines
With this patch we have seen an increase in transfer rate from less than 15MB/s to 80-460MB/s, depending on size of the transfer. This makes a big difference in time needed to save a system dump.
(Does anyone know of a reason why
copy_oldmem_page()would need
to use uncached addresses?)Diffed against 2.6.36-rc3
I believe this code simply predates being able to specify the caching attributes at ioremap time. Being cached in this case actually looks more correct, as that is the default for RAM and we are talking about RAM.
Ultimately either there is another cpu running wild with these pages mapped with some random set of attributes, and we cannot get the permissions right or we have captured all of the cpus and this is the only mapping so it doesn't matter.
Quoted 24 lines
Signed-off-by Cliff Wickman <[email protected]>--- arch/x86/kernel/crash_dump_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
linus.current/arch/x86/kernel/crash_dump_64.c
===================================================================arch/x86/kernel/crash_dump_64.c +1
-1@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pif (!csize)return 0 ; - vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); + vaddr =ioremap_cache (pfn <<PAGE_SHIFT ,PAGE_SIZE );if (!vaddr)return -ENOMEM ;_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Ingo Molnar
AppliedQuoted 21 lines · Eric W. Biederman
Quoted 5 lines · Cliff Wickman
From: Cliff Wickman <[email protected]>
The copy of
/proc/vmcoreto a user buffer proceeds much faster if the kernel addresses memory as cached.Quoted 8 lines
With this patch we have seen an increase in transfer rate from less than 15MB/s to 80-460MB/s, depending on size of the transfer. This makes a big difference in time needed to save a system dump.
(Does anyone know of a reason why
copy_oldmem_page()would need
to use uncached addresses?)Diffed against 2.6.36-rc3
I believe this code simply predates being able to specify the caching attributes at ioremap time. Being cached in this case actually looks more correct, as that is the default for RAM and we are talking about RAM.
Quoted 6 lines
Ultimately either there is another cpu running wild with these pages mapped with some random set of attributes, and we cannot get the permissions right or we have captured all of the cpus and this is the only mapping so it doesn't matter.
Applied, thanks guys. Note, i also added a -stable tag, as kdump is typically used with enterprise setups and we want this (low-risk, high-impact) improvement to be propagated far back the -stable series.
Thanks,
Ingo
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 5 lines · Cliff Wickman
From: Cliff Wickman <cpw-sJ/[email protected]>
The copy of
/proc/vmcoreto a user buffer proceeds much faster if the kernel addresses memory as cached.
Quoted 8 lines
With this patch we have seen an increase in transfer rate from less than 15MB/s to 80-460MB/s, depending on size of the transfer. This makes a big difference in time needed to save a system dump.
(Does anyone know of a reason why
copy_oldmem_page()would need
to use uncached addresses?)Diffed against 2.6.36-rc3
I had a similar patch somewhere in my private kernels, yes it's a big win. I think it was simply a bug that was added when ioremap was changed to default to uncached.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
[tip:x86/mm] x86, kdump: Change copy_oldmem_page() to use cached addressing
In reply to Cliff WickmanCommit-ID: 37a2f9f30a360fb03522d15c85c78265ccd80287 Gitweb: http://git.kernel.org/tip/37a2f9f30a360fb03522d15c85c78265ccd80287 Author: Cliff Wickman <[email protected]> AuthorDate: Wed, 8 Sep 2010 10:14:27 -0500 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 9 Sep 2010 09:46:23 +0200
x86, kdump: Change copy_oldmem_page() to use cached addressing
The copy of /proc/vmcore to a user buffer proceeds much faster if the kernel addresses memory as cached.
With this patch we have seen an increase in transfer rate from less than 15MB/s to 80-460MB/s, depending on size of the transfer. This makes a big difference in time needed to save a system dump.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/crash_dump_64.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/crash_dump_64.c +1 -1
@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,if (!csize)return 0 ; - vaddr =ioremap (pfn <<PAGE_SHIFT ,PAGE_SIZE ); + vaddr =ioremap_cache (pfn <<PAGE_SHIFT ,PAGE_SIZE );if (!vaddr)return -ENOMEM ;