1
0
Fork 0
alistair23-linux/drivers
David Rientjes 5ff7091f5a mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks
Commit 4d4bbd8526 ("mm, oom_reaper: skip mm structs with mmu
notifiers") prevented the oom reaper from unmapping private anonymous
memory with the oom reaper when the oom victim mm had mmu notifiers
registered.

The rationale is that doing mmu_notifier_invalidate_range_{start,end}()
around the unmap_page_range(), which is needed, can block and the oom
killer will stall forever waiting for the victim to exit, which may not
be possible without reaping.

That concern is real, but only true for mmu notifiers that have
blockable invalidate_range_{start,end}() callbacks.  This patch adds a
"flags" field to mmu notifier ops that can set a bit to indicate that
these callbacks do not block.

The implementation is steered toward an expensive slowpath, such as
after the oom reaper has grabbed mm->mmap_sem of a still alive oom
victim.

[rientjes@google.com: mmu_notifier_invalidate_range_end() can also call the invalidate_range() must not block, fix comment]
  Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1801091339570.240101@chino.kir.corp.google.com
[akpm@linux-foundation.org: make mm_has_blockable_invalidate_notifiers() return bool, use rwsem_is_locked()]
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1712141329500.74052@chino.kir.corp.google.com
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Dimitri Sivanich <sivanich@hpe.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-01-31 17:18:38 -08:00
..
accessibility
acpi DMAengine updates for v4.16-rc1 2018-01-31 11:52:20 -08:00
amba A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
android Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
ata Merge branch 'for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2018-01-30 14:48:30 -08:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-29 13:10:25 -08:00
auxdisplay auxdisplay: img-ascii-lcd: Only build on archs that have IOMEM 2017-11-27 12:36:45 -08:00
base DMAengine updates for v4.16-rc1 2018-01-31 11:52:20 -08:00
bcma bcma: Fix 'allmodconfig' and BCMA builds on MIPS targets 2018-01-16 21:13:55 +02:00
block Merge branch 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 18:59:03 -08:00
bluetooth the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
bus Merge branches 'pm-domains', 'pm-kconfig', 'pm-cpuidle' and 'powercap' 2018-01-18 02:54:45 +01:00
cdrom Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
char Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
clk clk: use atomic runtime pm api in clk_core_is_enabled 2017-12-26 17:34:03 -08:00
clocksource clocksource/drivers/stm32: Start the timer's counter sooner 2018-01-08 17:57:26 +01:00
connector
cpufreq Merge branch 'pm-cpufreq-thermal' into pm-cpufreq 2018-01-18 02:52:42 +01:00
cpuidle cpuidle: Avoid NULL argument in cpuidle_switch_governor() 2018-01-05 14:01:30 +01:00
crypto dma-mapping: move swiotlb arch helpers to a new header 2018-01-10 16:40:54 +01:00
dax device-dax: implement ->split() to catch invalid munmap attempts 2017-11-29 18:40:42 -08:00
dca
devfreq PM / devfreq: Fix potential NULL pointer dereference in governor_store 2018-01-02 09:36:54 +09:00
dio
dma DMAengine updates for v4.16-rc1 2018-01-31 11:52:20 -08:00
dma-buf the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
edac EDAC, mv64x60: Fix an error handling path 2018-01-09 20:14:23 +01:00
eisa
extcon extcon: axp288: Remove unused platform data 2018-01-03 10:11:02 +09:00
firewire the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
firmware arm64 updates for 4.16: 2018-01-30 13:57:43 -08:00
fmc
fpga Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
fsi
gpio Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
gpu Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-31 09:25:20 -08:00
hid Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
hsi the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
hv Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
hwmon hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 2018-01-27 09:34:22 -08:00
hwspinlock hwspinlock update for v4.15 2017-11-17 20:16:20 -08:00
hwtracing arm64 updates for 4.16: 2018-01-30 13:57:43 -08:00
i2c Power management updates for v4.16-rc1 2018-01-29 09:47:41 -08:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide 2017-11-19 08:04:41 -10:00
idle Merge branch 'pm-cpuidle' 2017-11-13 01:34:14 +01:00
iio Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
infiniband mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks 2018-01-31 17:18:38 -08:00
input Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
iommu mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks 2018-01-31 17:18:38 -08:00
ipack
irqchip arm64 updates for 4.16: 2018-01-30 13:57:43 -08:00
isdn Merge branch 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 18:59:03 -08:00
leds Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
lightnvm lightnvm: pblk: refactor pblk_ppa_comp function 2018-01-05 08:50:12 -07:00
macintosh the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
mailbox the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
mcb
md - DM core fixes to ensure that bio submission follows a depth-first tree 2018-01-31 11:05:47 -08:00
media Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-31 09:25:20 -08:00
memory mtd: onenand: omap2: Configure driver from DT 2018-01-12 16:41:15 +01:00
memstick misc: rtsx: Move Realtek Card Reader Driver to misc 2017-11-29 10:16:44 +00:00
message scsi: mptsas: remove duplicated assignment to pointer head 2018-01-17 01:19:38 -05:00
mfd regmap: Updates for v4.16 2018-01-29 11:35:24 -08:00
misc mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks 2018-01-31 17:18:38 -08:00
mmc There are two major achievements for MMC in this release, which deserves to be 2018-01-29 11:26:11 -08:00
mtd dma mapping changes for Linux 4.16: 2018-01-31 11:32:27 -08:00
mux mux: core: fix double get_device() 2018-01-09 14:19:41 +01:00
net First merge window pull request for 4.16 2018-01-31 12:05:10 -08:00
nfc treewide: setup_timer() -> timer_setup() (2 field) 2017-11-21 15:57:09 -08:00
ntb treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
nubus nubus: Add support for the driver model 2018-01-16 16:47:29 +01:00
nvdimm libnvdimm, btt: Fix an incompatibility in the log layout 2017-12-21 14:59:27 -08:00
nvme Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block 2018-01-29 11:51:49 -08:00
nvmem nvmem: meson-mx-efuse: fix reading from an offset other than 0 2017-12-23 16:46:23 +01:00
of DMAengine updates for v4.16-rc1 2018-01-31 11:52:20 -08:00
opp PM / OPP: Make local function ti_opp_supply_set_opp() static 2017-12-28 12:48:16 +01:00
oprofile
parisc parisc: Show unhashed EISA EEPROM address 2018-01-02 21:01:02 +01:00
parport Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
pci Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
pcmcia drivers/pcmcia/sa1111_badge4.c: avoid unused function warning 2017-11-17 16:10:04 -08:00
perf perf: dsu: Use signed field for dsu_pmu->num_counters 2018-01-15 18:02:17 +00:00
phy Merge branch 'for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2018-01-30 14:48:30 -08:00
pinctrl genirq/irqdomain: Rename early argument of irq_domain_activate_irq() 2017-12-29 21:13:04 +01:00
platform Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
pnp PNP: pnpbios: Use PTR_ERR_OR_ZERO() 2017-12-16 02:59:45 +01:00
power PM / AVS: rockchip-io: account for const type of of_device_id.data 2018-01-05 13:36:33 +01:00
powercap powercap: intel_rapl: Fix trailing semicolon 2018-01-17 12:56:24 +01:00
pps the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
ps3
ptp the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
pwm pwm: Changes for v4.15-rc1 2017-11-22 21:09:18 -10:00
rapidio the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
ras mm/memory_failure: Remove unused trapno from memory_failure 2018-01-23 12:17:42 -06:00
regulator Merge remote-tracking branch 'regulator/topic/tps65218' into regulator-next 2018-01-26 17:57:05 +00:00
remoteproc remoteproc updates for v4.15 2017-11-17 20:14:10 -08:00
reset ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
rpmsg the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
rtc the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
s390 Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
sbus Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2017-11-17 20:21:44 -08:00
scsi SCSI misc on 20180131 2018-01-31 11:23:28 -08:00
sfi
sh A couple of dma-mapping updates: 2017-11-14 16:54:12 -08:00
sn
soc meson-gx-socinfo: Fix package id parsing 2017-11-30 15:29:44 -08:00
spi Merge remote-tracking branch 'spi/topic/xilinx' into spi-next 2018-01-26 17:57:34 +00:00
spmi
ssb ssb: Disable PCI host for PCI_DRIVERS_GENERIC 2018-01-16 21:15:58 +02:00
staging Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-31 09:25:20 -08:00
target Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block 2018-01-29 11:51:49 -08:00
tc
tee optee: fix invalid of_node_put() in optee_driver_init() 2017-11-29 10:24:57 +01:00
thermal cpu_cooling: Drop static-power related stuff 2017-12-07 22:52:01 +01:00
thunderbolt thunderbolt: Mask ring interrupt properly when polling starts 2017-12-16 16:37:51 +01:00
tty Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
uio the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
usb Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
uwb treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
vfio annotate poll-related wait keys 2017-11-27 16:19:54 -05:00
vhost Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 17:58:07 -08:00
video m68k updates for 4.16 2018-01-29 16:37:15 -08:00
virt the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
virtio virtio_mmio: fix devm cleanup 2017-12-14 21:01:40 +02:00
vlynq
vme Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
w1 Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
watchdog watchdog: Add RAVE SP watchdog driver 2018-01-08 10:08:36 +00:00
xen dma mapping changes for Linux 4.16: 2018-01-31 11:32:27 -08:00
zorro
Kconfig Merge branches 'pm-cpufreq-sched' and 'pm-opp' 2017-11-13 01:40:52 +01:00
Makefile usb: build drivers/usb/common/ when USB_SUPPORT is set 2017-11-28 15:17:49 +01:00