linux/arch/x86
Roland Dreier b0d9e0106f x86, ioremap: Speed up check for RAM pages
commit c81c8a1eee upstream.

In __ioremap_caller() (the guts of ioremap), we loop over the range of
pfns being remapped and checks each one individually with page_is_ram().
For large ioremaps, this can be very slow.  For example, we have a
device with a 256 GiB PCI BAR, and ioremapping this BAR can take 20+
seconds -- sometimes long enough to trigger the soft lockup detector!

Internally, page_is_ram() calls walk_system_ram_range() on a single
page.  Instead, we can make a single call to walk_system_ram_range()
from __ioremap_caller(), and do our further checks only for any RAM
pages that we find.  For the common case of MMIO, this saves an enormous
amount of work, since the range being ioremapped doesn't intersect
system RAM at all.

With this change, ioremap on our 256 GiB BAR takes less than 1 second.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Link: http://lkml.kernel.org/r/1399054721-1331-1-git-send-email-roland@kernel.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 15:58:04 -07:00
..
boot x86/efi: Correct EFI boot stub use of code32_start 2014-05-06 07:55:30 -07:00
configs x86: Default to ARCH=x86 to avoid overriding CONFIG_64BIT 2012-12-20 14:37:18 -08:00
crypto crypto: sha512_ssse3 - fix byte count to bit count conversion 2014-07-17 15:58:01 -07:00
ia32 Introduce [compat_]save_altstack_ex() to unbreak x86 SMAP 2013-09-26 17:18:13 -07:00
include KVM: x86: preserve the high 32-bits of the PAT register 2014-07-09 11:14:02 -07:00
kernel x86_32, entry: Do syscall exit work on badsys (CVE-2014-4508) 2014-06-30 20:09:46 -07:00
kvm KVM: lapic: sync highest ISR to hardware apic on EOI 2014-06-26 15:12:39 -04:00
lguest Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:41:21 -07:00
lib x86, smap: Handle csum_partial_copy_*_user() 2013-09-26 17:18:13 -07:00
math-emu
mm x86, ioremap: Speed up check for RAM pages 2014-07-17 15:58:04 -07:00
net x86: bpf_jit: support negative offsets 2014-03-31 09:58:13 -07:00
oprofile oprofile, x86: Fix wrapping bug in op_x86_get_ctrl() 2012-10-15 14:38:24 +02:00
pci x86/PCI: Map PCI setup data with ioremap() so it can be in highmem 2013-06-05 10:50:04 -06:00
platform x86/efi: Fix off-by-one bug in EFI Boot Services reservation 2014-02-06 11:08:12 -08:00
power x86, gdt, hibernate: Store/load GDT for hibernate path. 2013-05-02 11:27:35 -07:00
realmode x86, build: Pass in additional -mno-mmx, -mno-sse options 2013-12-20 07:45:10 -08:00
syscalls x86, x32: Use compat shims for io_{setup,submit} 2014-06-30 20:09:45 -07:00
tools x86, relocs: Move __vvar_page from S_ABS to S_REL 2013-06-12 15:14:57 -07:00
um make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect 2013-03-03 22:58:33 -05:00
vdso x86-64, modify_ldt: Make support for 16-bit segments a runtime option 2014-06-07 13:25:38 -07:00
video
xen xen: Fix possible user space selector corruption 2014-02-22 12:41:25 -08:00
.gitignore
Kbuild
Kconfig x86: fix build error and kconfig for ia32_emulation and binfmt 2013-06-18 16:20:32 -05:00
Kconfig.cpu x86, 386 removal: Document Nx586 as a 386 and thus unsupported 2012-11-29 13:28:39 -08:00
Kconfig.debug Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2013-04-30 17:04:09 -07:00
Makefile x86, build: Pass in additional -mno-mmx, -mno-sse options 2013-12-20 07:45:10 -08:00
Makefile_32.cpu x86, 386 removal: Remove CONFIG_M386 from Kconfig 2012-11-29 13:23:01 -08:00
Makefile.um