linux/arch/arm
Kirill A. Shutemov b30fe6c7ce mm: fix false-positive warning on exit due mm_nr_pmds(mm)
The problem is that we check nr_ptes/nr_pmds in exit_mmap() which happens
*before* pgd_free().  And if an arch does pte/pmd allocation in
pgd_alloc() and frees them in pgd_free() we see offset in counters by the
time of the checks.

We tried to workaround this by offsetting expected counter value according
to FIRST_USER_ADDRESS for both nr_pte and nr_pmd in exit_mmap().  But it
doesn't work in some cases:

1. ARM with LPAE enabled also has non-zero USER_PGTABLES_CEILING, but
   upper addresses occupied with huge pmd entries, so the trick with
   offsetting expected counter value will get really ugly: we will have
   to apply it nr_pmds, but not nr_ptes.

2. Metag has non-zero FIRST_USER_ADDRESS, but doesn't do allocation
   pte/pmd page tables allocation in pgd_alloc(), just setup a pgd entry
   which is allocated at boot and shared accross all processes.

The proposal is to move the check to check_mm() which happens *after*
pgd_free() and do proper accounting during pgd_alloc() and pgd_free()
which would bring counters to zero if nothing leaked.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Tyler Baker <tyler.baker@linaro.org>
Tested-by: Tyler Baker <tyler.baker@linaro.org>
Tested-by: Nishanth Menon <nm@ti.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-11 17:06:04 -08:00
..
boot Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-02-11 09:32:08 -08:00
common Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
configs Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-27 16:59:56 -08:00
crypto crypto: arm - replace memset by memzero_explicit 2014-12-02 22:55:51 +08:00
firmware
include arm: define __PAGETABLE_PMD_FOLDED for !LPAE 2015-02-11 17:06:04 -08:00
kernel ACPI and power management updates for v3.20-rc1 2015-02-10 15:09:41 -08:00
kvm Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-02-09 14:28:42 -08:00
lib ARM: 8225/1: Add unwinding support for memory copy functions 2014-11-27 16:00:25 +00:00
mach-asm9260 ARM: add mach-asm9260 2014-11-28 15:06:38 +01:00
mach-at91 ARM: at91: board-dt-sama5: add phy_fixup to override NAND_Tree 2015-01-12 15:50:23 +01:00
mach-axxia
mach-bcm Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-10 08:38:57 -08:00
mach-berlin
mach-clps711x
mach-cns3xxx Merge branch 'pci/config' into next 2015-02-02 14:49:29 -06:00
mach-davinci More ACPI and power management updates for 3.19-rc1 2014-12-18 20:28:33 -08:00
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx arm: ep93xx: add dma_masks for the M2P and M2M DMA controllers 2014-11-28 12:34:08 +01:00
mach-exynos More ACPI and power management updates for 3.19-rc1 2014-12-18 20:28:33 -08:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-imx Revert "ARM: imx: add FEC sleep mode callback function" 2015-01-08 20:05:19 -08:00
mach-integrator ARM: integrator: Convert PCI to use generic config accessors 2015-01-29 08:34:42 -06:00
mach-iop13xx PCI/MSI: Rename mask/unmask_msi_irq treewide 2014-11-23 13:01:45 +01:00
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM 2014-12-13 00:42:49 +01:00
mach-ks8695 ARM: ks8695: Convert PCI to use generic config accessors 2015-01-30 16:14:43 -06:00
mach-lpc32xx
mach-mediatek ARM: SoC DT updates for 3.19 2014-12-09 14:57:37 -08:00
mach-meson
mach-mmp Please consider pulling the clk framework changes toward 3.19. It is 2014-12-20 16:42:36 -08:00
mach-moxart
mach-msm
mach-mv78xx0
mach-mvebu ARM: mvebu: don't set the PL310 in I/O coherency mode when I/O coherency is disabled 2015-01-28 11:23:56 -06:00
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1 ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM 2014-12-13 00:42:49 +01:00
mach-omap2 MMC core: 2015-02-11 10:56:48 -08:00
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
mach-qcom
mach-realview
mach-rockchip ARM: rockchip: disable jtag/sdmmc autoswitching on rk3288 2015-01-16 19:10:39 -08:00
mach-rpc
mach-s3c24xx Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
mach-s3c64xx
mach-s5pv210
mach-sa1100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-02-10 20:01:30 -08:00
mach-shmobile Third Round of Renesas ARM Based SoC Fixes for v3.19 2015-02-01 08:51:12 -08:00
mach-socfpga
mach-spear
mach-sti
mach-sunxi
mach-tegra ACPI and power management updates for 3.19-rc1 2014-12-10 21:17:00 -08:00
mach-u300 Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
mach-ux500
mach-versatile
mach-vexpress ARM: vexpress: Enable regulator framework when MMCI is in use 2014-11-28 21:57:07 +01:00
mach-vt8500
mach-w90x900
mach-zynq ARM: zynq: Remove secondary_startup() declaration from header 2014-12-01 09:32:22 +01:00
mm mm: fix false-positive warning on exit due mm_nr_pmds(mm) 2015-02-11 17:06:04 -08:00
net
nwfpe ARM: drop nwfpe initialisation message from warning to info level 2014-11-21 15:24:54 +00:00
oprofile
plat-iop
plat-omap
plat-orion ACPI and power management updates for 3.19-rc1 2014-12-10 21:17:00 -08:00
plat-pxa
plat-samsung Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
plat-versatile ARM: vexpress: Remove non-DT code 2014-11-28 16:08:16 +01:00
tools
vfp ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
xen xen/grant-table: pre-populate kernel unmap ops for xen_gnttab_unmap_refs() 2015-01-28 14:03:10 +00:00
Kconfig ARM/PCI: Move to generic PCI domains 2014-12-27 18:19:18 -07:00
Kconfig-nommu
Kconfig.debug Char/Misc driver patches for 3.19-rc1 2014-12-14 16:43:47 -08:00
Makefile