linux/arch/arm
Steven Capper a3a9ea656d ARM: 7858/1: mm: make UACCESS_WITH_MEMCPY huge page aware
The memory pinning code in uaccess_with_memcpy.c does not check
for HugeTLB or THP pmds, and will enter an infinite loop should
a __copy_to_user or __clear_user occur against a huge page.

This patch adds detection code for huge pages to pin_page_for_write.
As this code can be executed in a fast path it refers to the actual
pmds rather than the vma. If a HugeTLB or THP is found (they have
the same pmd representation on ARM), the page table spinlock is
taken to prevent modification whilst the page is pinned.

On ARM, huge pages are only represented as pmds, thus no huge pud
checks are performed. (For huge puds one would lock the page table
in a similar manner as in the pmd case).

Two helper functions are introduced; pmd_thp_or_huge will check
whether or not a page is huge or transparent huge (which have the
same pmd layout on ARM), and pmd_hugewillfault will detect whether
or not a page fault will occur on write to the page.

Running the following test (with the chunking from read_zero
removed):
 $ dd if=/dev/zero of=/dev/null bs=10M count=1024
Gave:  2.3 GB/s backed by normal pages,
       2.9 GB/s backed by huge pages,
       5.1 GB/s backed by huge pages, with page mask=HPAGE_MASK.

After some discussion, it was decided not to adopt the HPAGE_MASK,
as this would have a significant detrimental effect on the overall
system latency due to page_table_lock being held for too long.
This could be revisited if split huge page locks are adopted.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-10-29 11:06:15 +00:00
..
boot ARM: SoC fixes for 3.12-rc 2013-10-13 09:59:10 -07:00
common Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm 2013-10-14 10:02:23 -07:00
configs ARM: multi_v7_defconfig: add SDHCI for i.MX 2013-10-02 20:54:36 -07:00
crypto ARM: 7837/3: fix Thumb-2 bug in AES assembler code 2013-09-22 11:43:38 +01:00
include ARM: 7858/1: mm: make UACCESS_WITH_MEMCPY huge page aware 2013-10-29 11:06:15 +00:00
kernel ARM: 7855/1: Add check for Cortex-A15 errata 798181 ECO 2013-10-29 11:06:13 +00:00
kvm ARM: kvm: rename cpu_reset to avoid name clash 2013-09-24 11:15:05 -07:00
lib ARM: 7858/1: mm: make UACCESS_WITH_MEMCPY huge page aware 2013-10-29 11:06:15 +00:00
mach-at91 ARM: at91: sam9g45: shutdown ddr1 too when rebooting 2013-09-30 09:58:44 -07:00
mach-bcm
mach-bcm2835
mach-clps711x
mach-cns3xxx
mach-davinci ARM: davinci: dm365 evm: fix unused variable warning 2013-09-19 14:56:03 +05:30
mach-dove ARM: SoC board updates for 3.12 2013-09-06 13:34:43 -07:00
mach-ebsa110
mach-ep93xx ARM: SoC fixes for 3.12 2013-09-12 13:59:31 -07:00
mach-exynos ARM: SoC late changes for v3.12 2013-09-09 16:35:29 -07:00
mach-footbridge
mach-gemini
mach-highbank ARM: SoC late changes for v3.12 2013-09-09 16:35:29 -07:00
mach-imx ACPI and power management fixes for 3.12-rc2 2013-09-20 15:17:14 -07:00
mach-integrator ARM: mach-integrator: Add stub for pci_v3_early_init() for !CONFIG_PCI 2013-09-25 21:59:52 -07:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone Omap fixes for the merge window that are not urgent enough 2013-08-29 19:12:04 -07:00
mach-kirkwood ARM: SoC board updates for 3.12 2013-09-06 13:34:43 -07:00
mach-ks8695 gpio: (gpio-pca953x) move header to linux/platform_data/ 2013-08-29 12:33:52 -07:00
mach-lpc32xx
mach-mmp ARM: SoC late changes for v3.12 2013-09-09 16:35:29 -07:00
mach-msm ARM: SoC cleanups for 3.12 2013-09-06 13:21:16 -07:00
mach-mv78xx0 ARM: SoC platform changes for 3.12 2013-09-06 13:30:06 -07:00
mach-mvebu ARM: mvebu: add missing of_node_put() to fix reference leak 2013-09-18 16:40:53 +00:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1
mach-omap2 ARM: OMAP2: RX-51: Add missing max_current to rx51_lp5523_led_config 2013-10-08 11:22:43 -07:00
mach-orion5x ARM: SoC board updates for 3.12 2013-09-06 13:34:43 -07:00
mach-picoxcell
mach-prima2 ARM: SoC platform changes for 3.12 2013-09-06 13:30:06 -07:00
mach-pxa ARM: SoC DT updates for 3.12 2013-09-06 13:26:27 -07:00
mach-realview ARM: SoC cleanups for 3.12 2013-09-06 13:21:16 -07:00
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx gpio: (gpio-pca953x) move header to linux/platform_data/ 2013-08-29 12:33:52 -07:00
mach-s5p64x0
mach-s5pc100
mach-s5pv210
mach-sa1100 ARM: sa1100: collie.c: fall back to jedec_probe flash detection 2013-09-18 08:20:27 -07:00
mach-shark
mach-shmobile ARM: SoC fixes for 3.12-rc 2013-10-02 21:48:32 -07:00
mach-socfpga
mach-spear ARM: SoC cleanups for 3.12 2013-09-06 13:21:16 -07:00
mach-sti
mach-sunxi
mach-tegra ARM: SoC platform changes for 3.12 2013-09-06 13:30:06 -07:00
mach-u300 ARM: u300: hide submenus 2013-09-18 08:16:46 -07:00
mach-ux500 ARM: ux500: disable outer cache debug 2013-09-17 09:08:13 -07:00
mach-versatile Merge branch 'versatile/fixes' into fixes 2013-09-09 17:31:04 -07:00
mach-vexpress ARM: vexpress: tc2: fix hotplug/idle/kexec race on cluster power down 2013-09-30 09:27:36 -07:00
mach-virt
mach-vt8500
mach-w90x900
mach-zynq
mm ARM: 7840/1: LPAE: don't reject mapping /dev/mem above 4GB 2013-10-29 11:06:03 +00:00
net
nwfpe
oprofile
plat-iop
plat-omap ARM: SoC platform changes for 3.12 2013-09-06 13:30:06 -07:00
plat-orion
plat-pxa ARM: pxa: ssp: Check return values from phandle lookups 2013-09-09 17:14:09 -07:00
plat-samsung ARM: SoC cleanups for 3.12 2013-09-06 13:21:16 -07:00
plat-versatile
tools
vfp
xen Linux 3.11-rc7 2013-09-09 12:05:37 -04:00
Kconfig ARM: 7854/1: lockref: add support for lockless lockrefs using cmpxchg64 2013-10-29 11:06:11 +00:00
Kconfig-nommu
Kconfig.debug ARM: 7850/1: DEBUG_LL on efm32 SoCs 2013-10-29 11:06:04 +00:00
Makefile arm, kbuild: make "make install" not depend on vmlinux 2013-10-02 22:30:35 +02:00