summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2020-04-03 08:17:50 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2020-04-03 08:18:27 +0200
commitfae4e1d295add727d077751dbdc25d81384ec4a6 (patch)
tree8f8accb1c63ef8530ba7eedc82930e86196dc0bc /mm
parentc5d2219efd8df80fba9ab557e45a845c2b54e5bf (diff)
parent4520f06b03ae667e442da1ab9351fd28cd7ac598 (diff)
Merge 4.14.175 into android-4.14
Changes in 4.14.175 spi: qup: call spi_qup_pm_resume_runtime before suspending powerpc: Include .BTF section ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes spi: pxa2xx: Add CS control clock quirk spi/zynqmp: remove entry that causes a cs glitch drm/exynos: dsi: propagate error value and silence meaningless warning drm/exynos: dsi: fix workaround for the legacy clock name drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer altera-stapl: altera_get_note: prevent write beyond end of 'key' dm bio record: save/restore bi_end_io and bi_integrity xenbus: req->body should be updated before req->state xenbus: req->err should be updated before req->state block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() parse-maintainers: Mark as executable USB: Disable LPM on WD19's Realtek Hub usb: quirks: add NO_LPM quirk for RTL8153 based ethernet adapters USB: serial: option: add ME910G1 ECM composition 0x110b usb: host: xhci-plat: add a shutdown USB: serial: pl2303: add device-id for HP LD381 usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c ALSA: line6: Fix endless MIDI read loop ALSA: seq: virmidi: Fix running status after receiving sysex ALSA: seq: oss: Fix running status after receiving sysex ALSA: pcm: oss: Avoid plugin buffer overflow ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks iio: trigger: stm32-timer: disable master mode when stopping iio: magnetometer: ak8974: Fix negative raw values in sysfs mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2 staging: rtl8188eu: Add device id for MERCUSYS MW150US v2 staging/speakup: fix get_word non-space look-ahead intel_th: Fix user-visible error codes intel_th: pci: Add Elkhart Lake CPU support rtc: max8907: add missing select REGMAP_IRQ xhci: Do not open code __print_symbolic() in xhci trace events memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event mm: slub: be more careful about the double cmpxchg of freelist mm, slub: prevent kmalloc_node crashes and memory leaks page-flags: fix a crash at SetPageError(THP_SWAP) x86/mm: split vmalloc_sync_all() USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL USB: cdc-acm: fix rounding error in TIOCSSERIAL iio: adc: at91-sama5d2_adc: fix channel configuration for differential channels iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode kbuild: Disable -Wpointer-to-enum-cast futex: Fix inode life-time issue futex: Unbreak futex hashing Revert "vrf: mark skb for multicast or link-local as enslaved to VRF" Revert "ipv6: Fix handling of LLA with VRF and sockets bound to VRF" ALSA: hda/realtek: Fix pop noise on ALC225 arm64: smp: fix smp_send_stop() behaviour arm64: smp: fix crash_smp_send_stop() behaviour drm/bridge: dw-hdmi: fix AVI frame colorimetry staging: greybus: loopback_test: fix potential path truncation staging: greybus: loopback_test: fix potential path truncations Revert "drm/dp_mst: Skip validating ports during destruction, just ref" hsr: fix general protection fault in hsr_addr_is_self() macsec: restrict to ethernet devices net: dsa: Fix duplicate frames flooded by learning net: mvneta: Fix the case where the last poll did not process all rx net/packet: tpacket_rcv: avoid a producer race condition net: qmi_wwan: add support for ASKEY WWHC050 net_sched: cls_route: remove the right filter from hashtable net_sched: keep alloc_hash updated after hash allocation net: stmmac: dwmac-rk: fix error path in rk_gmac_probe NFC: fdp: Fix a signedness bug in fdp_nci_send_patch() slcan: not call free_netdev before rtnl_unlock in slcan_open bnxt_en: fix memory leaks in bnxt_dcbnl_ieee_getets() net: dsa: mt7530: Change the LINK bit to reflect the link status vxlan: check return value of gro_cells_init() hsr: use rcu_read_lock() in hsr_get_node_{list/status}() hsr: add restart routine into hsr_get_node_list() hsr: set .netnsok flag net: ipv4: don't let PMTU updates increase route MTU cgroup-v1: cgroup_pidlist_next should update position index cpupower: avoid multiple definition with gcc -fno-common drivers/of/of_mdio.c:fix of_mdiobus_register() cgroup1: don't call release_agent when it is "" dt-bindings: net: FMan erratum A050385 arm64: dts: ls1043a: FMan erratum A050385 fsl/fman: detect FMan erratum A050385 scsi: ipr: Fix softlockup when rescanning devices in petitboot mac80211: Do not send mesh HWMP PREQ if HWMP is disabled dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom sxgbe: Fix off by one in samsung driver strncpy size arg arm64: ptrace: map SPSR_ELx<->PSR for compat tasks arm64: compat: map SPSR_ELx<->PSR for signals ftrace/x86: Anotate text_mutex split between ftrace_arch_code_modify_post_process() and ftrace_arch_code_modify_prepare() i2c: hix5hd2: add missed clk_disable_unprepare in remove Input: synaptics - enable RMI on HP Envy 13-ad105ng Input: avoid BIT() macro usage in the serio.h UAPI header ARM: dts: dra7: Add bus_dma_limit for L3 bus ARM: dts: omap5: Add bus_dma_limit for L3 bus perf probe: Do not depend on dwfl_module_addrsym() tools: Let O= makes handle a relative path with -C option scripts/dtc: Remove redundant YYLOC global declaration scsi: sd: Fix optimal I/O size for devices that change reported values mac80211: mark station unauthorized before key removal gpiolib: acpi: Correct comment for HP x2 10 honor_wakeup quirk gpiolib: acpi: Rework honor_wakeup option into an ignore_wake option gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 BYT + AXP288 model RDMA/core: Ensure security pkey modify is not lost genirq: Fix reference leaks on irq affinity notifiers xfrm: handle NETDEV_UNREGISTER for xfrm device vti[6]: fix packet tx through bpf_redirect() in XinY cases RDMA/mlx5: Block delay drop to unprivileged users xfrm: fix uctx len check in verify_sec_ctx_len xfrm: add the missing verify_sec_ctx_len check in xfrm_add_acquire xfrm: policy: Fix doulbe free in xfrm_policy_timer netfilter: nft_fwd_netdev: validate family and chain type vti6: Fix memory leak of skb if input policy check fails Input: raydium_i2c_ts - use true and false for boolean values Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger() afs: Fix some tracing details USB: serial: option: add support for ASKEY WWHC050 USB: serial: option: add BroadMobi BM806U USB: serial: option: add Wistron Neweb D19Q1 USB: cdc-acm: restore capability check order USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback usb: musb: fix crash with highmen PIO and usbmon media: flexcop-usb: fix endpoint sanity check media: usbtv: fix control-message timeouts staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device table staging: wlan-ng: fix ODEBUG bug in prism2sta_disconnect_usb staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback libfs: fix infoleak in simple_attr_read() media: ov519: add missing endpoint sanity checks media: dib0700: fix rc endpoint lookup media: stv06xx: add missing descriptor sanity checks media: xirlink_cit: add missing descriptor sanity checks mac80211: Check port authorization in the ieee80211_tx_dequeue() case mac80211: fix authentication with iwlwifi/mvm vt: selection, introduce vc_is_sel vt: ioctl, switch VT_IS_IN_USE and VT_BUSY to inlines vt: switch vt_dont_switch to bool vt: vt_ioctl: remove unnecessary console allocation checks vt: vt_ioctl: fix VT_DISALLOCATE freeing in-use virtual console vt: vt_ioctl: fix use-after-free in vt_in_use() platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI table bpf: Explicitly memset the bpf_attr structure bpf: Explicitly memset some bpf info structures declared on the stack gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 CHT + AXP288 model net: ks8851-ml: Fix IO operations, again arm64: alternative: fix build with clang integrated assembler perf map: Fix off by one in strncpy() size argument ARM: dts: oxnas: Fix clear-mask property ARM: bcm2835-rpi-zero-w: Add missing pinctrl name arm64: dts: ls1043a-rdb: correct RGMII delay mode to rgmii-id arm64: dts: ls1046ardb: set RGMII interfaces to RGMII_ID mode Linux 4.14.175 Change-Id: If2c2cb5b3745ed6fbc5cb77737cfb1758fea4cb9 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c10
-rw-r--r--mm/nommu.c10
-rw-r--r--mm/slub.c32
-rw-r--r--mm/vmalloc.c11
4 files changed, 43 insertions, 20 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5d6ebd1449f0..d8df500e0eea 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3518,7 +3518,7 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg,
struct mem_cgroup_thresholds *thresholds;
struct mem_cgroup_threshold_ary *new;
unsigned long usage;
- int i, j, size;
+ int i, j, size, entries;
mutex_lock(&memcg->thresholds_lock);
@@ -3538,14 +3538,20 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg,
__mem_cgroup_threshold(memcg, type == _MEMSWAP);
/* Calculate new number of threshold */
- size = 0;
+ size = entries = 0;
for (i = 0; i < thresholds->primary->size; i++) {
if (thresholds->primary->entries[i].eventfd != eventfd)
size++;
+ else
+ entries++;
}
new = thresholds->spare;
+ /* If no items related to eventfd have been cleared, nothing to do */
+ if (!entries)
+ goto unlock;
+
/* Set thresholds array to NULL if we don't have thresholds */
if (!size) {
kfree(new);
diff --git a/mm/nommu.c b/mm/nommu.c
index 17c00d93de2e..13fc62d97544 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -450,10 +450,14 @@ void vm_unmap_aliases(void)
EXPORT_SYMBOL_GPL(vm_unmap_aliases);
/*
- * Implement a stub for vmalloc_sync_all() if the architecture chose not to
- * have one.
+ * Implement a stub for vmalloc_sync_[un]mapping() if the architecture
+ * chose not to have one.
*/
-void __weak vmalloc_sync_all(void)
+void __weak vmalloc_sync_mappings(void)
+{
+}
+
+void __weak vmalloc_sync_unmappings(void)
{
}
diff --git a/mm/slub.c b/mm/slub.c
index 67ea747da56c..766e3bd0483f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1965,8 +1965,6 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node,
if (node == NUMA_NO_NODE)
searchnode = numa_mem_id();
- else if (!node_present_pages(node))
- searchnode = node_to_mem_node(node);
object = get_partial_node(s, get_node(s, searchnode), c, flags);
if (object || node != NUMA_NO_NODE)
@@ -2563,17 +2561,27 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
struct page *page;
page = c->page;
- if (!page)
+ if (!page) {
+ /*
+ * if the node is not online or has no normal memory, just
+ * ignore the node constraint
+ */
+ if (unlikely(node != NUMA_NO_NODE &&
+ !node_state(node, N_NORMAL_MEMORY)))
+ node = NUMA_NO_NODE;
goto new_slab;
+ }
redo:
if (unlikely(!node_match(page, node))) {
- int searchnode = node;
-
- if (node != NUMA_NO_NODE && !node_present_pages(node))
- searchnode = node_to_mem_node(node);
-
- if (unlikely(!node_match(page, searchnode))) {
+ /*
+ * same as above but node_match() being false already
+ * implies node != NUMA_NO_NODE
+ */
+ if (!node_state(node, N_NORMAL_MEMORY)) {
+ node = NUMA_NO_NODE;
+ goto redo;
+ } else {
stat(s, ALLOC_NODE_MISMATCH);
deactivate_slab(s, page, c->freelist, c);
goto new_slab;
@@ -2998,11 +3006,13 @@ redo:
barrier();
if (likely(page == c->page)) {
- set_freepointer(s, tail_obj, c->freelist);
+ void **freelist = READ_ONCE(c->freelist);
+
+ set_freepointer(s, tail_obj, freelist);
if (unlikely(!this_cpu_cmpxchg_double(
s->cpu_slab->freelist, s->cpu_slab->tid,
- c->freelist, tid,
+ freelist, tid,
head, next_tid(tid)))) {
note_cmpxchg_failure("slab_free", s, tid);
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d067e1779e4c..5fff24ddc17b 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1779,7 +1779,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
* First make sure the mappings are removed from all page-tables
* before they are freed.
*/
- vmalloc_sync_all();
+ vmalloc_sync_unmappings();
/*
* In this function, newly allocated vm_struct has VM_UNINITIALIZED
@@ -2328,16 +2328,19 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
EXPORT_SYMBOL(remap_vmalloc_range);
/*
- * Implement a stub for vmalloc_sync_all() if the architecture chose not to
- * have one.
+ * Implement stubs for vmalloc_sync_[un]mappings () if the architecture chose
+ * not to have one.
*
* The purpose of this function is to make sure the vmalloc area
* mappings are identical in all page-tables in the system.
*/
-void __weak vmalloc_sync_all(void)
+void __weak vmalloc_sync_mappings(void)
{
}
+void __weak vmalloc_sync_unmappings(void)
+{
+}
static int f(pte_t *pte, pgtable_t table, unsigned long addr, void *data)
{