1
0
Fork 0
remarkable-linux/mm
Steven Rostedt 0c0844f9fa 4.1.28 Fix bad backport of 8f182270df "mm/swap.c: flush lru pvecs on compound page arrival"
When I pulled in 4.1.28 into my stable 4.1-rt tree and ran the tests,
it crashed with a severe OOM killing everything. I then tested 4.1.28
without -rt and it had the same issue. I did a bisect between 4.1.27
and 4.1.28 and found that the bug started at:

commit 8f182270df "mm/swap.c: flush lru pvecs on compound page
arrival"

Looking at that patch and what's in mainline, I see that there's a
mismatch in one of the hunks:

Mainline:

@@ -391,9 +391,8 @@ static void __lru_cache_add(struct page *page)
        struct pagevec *pvec = &get_cpu_var(lru_add_pvec);

        get_page(page);
-       if (!pagevec_space(pvec))
+       if (!pagevec_add(pvec, page) || PageCompound(page))
                __pagevec_lru_add(pvec);
-       pagevec_add(pvec, page);
        put_cpu_var(lru_add_pvec);
 }

Stable 4.1.28:

@@ -631,9 +631,8 @@ static void __lru_cache_add(struct page *page)
        struct pagevec *pvec = &get_cpu_var(lru_add_pvec);

        page_cache_get(page);
-       if (!pagevec_space(pvec))
+       if (!pagevec_space(pvec) || PageCompound(page))
                __pagevec_lru_add(pvec);
-       pagevec_add(pvec, page);
        put_cpu_var(lru_add_pvec);
 }

Where mainline replace pagevec_space() with pagevec_add, and stable did
not.

Fixing this makes the OOM go away.

Note, 3.18 has the same bug.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2016-07-22 10:30:03 -03:00
..
kasan mm/mempool.c: kasan: poison mempool elements 2015-04-15 16:35:20 -07:00
Kconfig mm: cma: debugfs interface 2015-04-14 16:49:00 -07:00
Kconfig.debug mm/debug_pagealloc: remove obsolete Kconfig options 2015-01-08 15:10:52 -08:00
Makefile mm: move memtest under mm 2015-04-14 16:49:06 -07:00
backing-dev.c block: discard bdi_unregister() in favour of bdi_destroy() 2015-05-28 10:12:42 -06:00
balloon_compaction.c virtio_balloon: fix race between migration and ballooning 2016-02-03 15:31:09 -05:00
bootmem.c mm: page_alloc: pass PFN to __free_pages_bootmem 2016-04-18 08:51:09 -04:00
cleancache.c cleancache: remove limit on the number of cleancache enabled filesystems 2015-04-14 16:49:03 -07:00
cma.c mm: cma: add trace events for CMA allocations and freeings 2015-04-15 16:35:19 -07:00
cma.h mm: cma: allocation trigger 2015-04-14 16:49:00 -07:00
cma_debug.c mm/cma_debug.c: remove blank lines before DEFINE_SIMPLE_ATTRIBUTE() 2015-04-15 16:35:20 -07:00
compaction.c mm, compaction: abort free scanner if split fails 2016-07-10 22:27:11 -04:00
debug-pagealloc.c mm/debug-pagealloc: make debug-pagealloc boottime configurable 2014-12-13 12:42:48 -08:00
debug.c mm: account pmd page tables to the process 2015-02-11 17:06:04 -08:00
dmapool.c mm/dmapool.c: fixed a brace coding style issue 2014-10-09 22:26:00 -04:00
early_ioremap.c mm: create generic early_ioremap() support 2014-04-07 16:36:15 -07:00
fadvise.c vfs: remove get_xip_mem 2015-02-16 17:56:03 -08:00
failslab.c
filemap.c mm: make sendfile(2) killable 2015-11-09 14:33:34 -08:00
frontswap.c mm/frontswap.c: fix the condition in BUG_ON 2014-12-10 17:41:08 -08:00
gup.c mm: use READ_ONCE() for non-scalar types 2015-04-15 16:35:18 -07:00
highmem.c mm/highmem: make kmap cache coloring aware 2014-08-06 18:01:22 -07:00
huge_memory.c mm: check __PG_HWPOISON separately from PAGE_FLAGS_CHECK_AT_* 2016-05-17 13:42:51 -04:00
hugetlb.c mm: use 'unsigned int' for page order 2016-04-18 08:51:09 -04:00
hugetlb_cgroup.c mm: page_counter: pull "-1" handling out of page_counter_memparse() 2015-02-11 17:06:02 -08:00
hwpoison-inject.c mm/hwpoison-inject: check PageLRU of hpage 2015-05-05 17:10:11 -07:00
init-mm.c
internal.h mm: use 'unsigned int' for page order 2016-04-18 08:51:09 -04:00
interval_tree.c mm: replace vma->sharead.linear with vma->shared 2015-02-10 14:30:31 -08:00
kmemcheck.c mm/slab_common: move kmem_cache definition to internal header 2014-10-09 22:25:50 -04:00
kmemleak-test.c mm/kmemleak-test.c: use pr_fmt for logging 2014-06-06 16:08:18 -07:00
kmemleak.c mm: kmemleak_alloc_percpu() should follow the gfp from per_alloc() 2015-07-21 10:10:03 -07:00
ksm.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
list_lru.c memcg: reparent list_lrus and free kmemcg_id on css offline 2015-02-12 18:54:10 -08:00
maccess.c
madvise.c vfs: remove get_xip_mem 2015-02-16 17:56:03 -08:00
memblock.c mm: page_alloc: pass PFN to __free_pages_bootmem 2016-04-18 08:51:09 -04:00
memcontrol.c mm: memcontrol: reclaim when shrinking memory.high below usage 2016-04-18 08:51:02 -04:00
memory-failure.c mm: soft-offline: don't free target page in successful page migration 2016-05-17 13:42:50 -04:00
memory.c mm: thp: fix SMP race condition between THP page fault and MADV_DONTNEED 2016-03-09 13:15:11 -05:00
memory_hotplug.c mm/memory_hotplug.c: set zone->wait_table to null after freeing it 2015-06-10 16:43:43 -07:00
mempolicy.c mm, thp: respect MPOL_PREFERRED policy with non-local node 2015-07-21 10:10:04 -07:00
mempool.c mm/mempool.c: kasan: poison mempool elements 2015-04-15 16:35:20 -07:00
memtest.c memtest: use phys_addr_t for physical addresses 2015-04-14 16:49:06 -07:00
migrate.c mm: Export migrate_page_move_mapping and migrate_page_copy 2016-07-10 20:20:01 -04:00
mincore.c mincore: apply page table walker on do_mincore() 2015-02-11 17:06:06 -08:00
mlock.c mm: fix mlock accouting 2016-02-15 15:45:19 -05:00
mm_init.c mm/mm_init.c: mark mminit_loglevel __meminitdata 2015-02-12 18:54:11 -08:00
mmap.c mm: fix regression in remap_file_pages() emulation 2016-03-04 10:25:45 -05:00
mmu_context.c sched/mm: call finish_arch_post_lock_switch in idle_task_exit and use_mm 2014-02-21 08:50:17 +01:00
mmu_notifier.c mmu_notifier: add the callback for mmu_notifier_invalidate_range() 2014-11-13 13:46:09 +11:00
mmzone.c mm: microoptimize zonelist operations 2015-02-11 17:06:02 -08:00
mprotect.c mm: numa: preserve PTE write permissions across a NUMA hinting fault 2015-03-25 16:20:31 -07:00
mremap.c mm/mremap.c: clean up goto just return ERR_PTR 2015-04-15 16:35:18 -07:00
msync.c mm: remove rest usage of VM_NONLINEAR and pte_file() 2015-02-10 14:30:31 -08:00
nobootmem.c mm: page_alloc: pass PFN to __free_pages_bootmem 2016-04-18 08:51:09 -04:00
nommu.c nommu: use __vfs_read() 2015-04-11 22:27:56 -04:00
oom_kill.c mm/oom_kill.c: fix typo in comment 2015-04-15 16:35:16 -07:00
page-writeback.c writeback: use |1 instead of +1 to protect against div by zero 2015-04-23 10:36:33 -06:00
page_alloc.c mm: update min_free_kbytes from khugepaged after core initialization 2016-07-10 23:07:19 -04:00
page_counter.c mm: page_counter: pull "-1" handling out of page_counter_memparse() 2015-02-11 17:06:02 -08:00
page_ext.c mm/page_owner: keep track of page owners 2014-12-13 12:42:48 -08:00
page_io.c direct_IO: remove rw from a_ops->direct_IO() 2015-04-11 22:29:45 -04:00
page_isolation.c mm: fix invalid node in alloc_migrate_target() 2016-07-10 23:06:57 -04:00
page_owner.c mm/page_owner.c: remove unnecessary stack_trace field 2015-02-11 17:06:07 -08:00
pagewalk.c mm/pagewalk.c: prevent positive return value of walk_page_test() from being passed to callers 2015-03-25 16:20:30 -07:00
percpu-km.c percpu: implmeent pcpu_nr_empty_pop_pages and chunk->nr_populated 2014-09-02 14:46:05 -04:00
percpu-vm.c percpu: move region iterations out of pcpu_[de]populate_chunk() 2014-09-02 14:46:02 -04:00
percpu.c percpu: fix synchronization between synchronous map extension and chunk destruction 2016-07-10 20:19:50 -04:00
pgtable-generic.c mm: convert p[te|md]_mknonnuma and remaining page table manipulations 2015-02-12 18:54:08 -08:00
process_vm_access.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2016-04-11 22:07:35 -04:00
quicklist.c
readahead.c fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info 2015-01-20 14:03:04 -07:00
rmap.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
shmem.c tmpfs: fix regression hang in fallocate undo 2016-07-12 08:41:10 -04:00
slab.c mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) 2015-10-22 14:43:27 -07:00
slab.h slub: make dead caches discard free slabs immediately 2015-02-12 18:54:10 -08:00
slab_common.c mm: slub: add kernel address sanitizer support for slub allocator 2015-02-13 21:21:41 -08:00
slob.c slob: make slob_alloc_node() static and remove EXPORT_SYMBOL() 2015-04-14 16:48:59 -07:00
slub.c mm: make page pfmemalloc check more robust 2015-09-29 19:26:06 +02:00
sparse-vmemmap.c mm/sparse: use memblock apis for early memory allocations 2014-01-21 16:19:47 -08:00
sparse.c mm: use macros from compiler.h instead of __attribute__((...)) 2014-04-07 16:35:54 -07:00
swap.c 4.1.28 Fix bad backport of 8f182270df "mm/swap.c: flush lru pvecs on compound page arrival" 2016-07-22 10:30:03 -03:00
swap_cgroup.c mm: page_cgroup: rename file to mm/swap_cgroup.c 2014-12-10 17:41:09 -08:00
swap_state.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
swapfile.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
truncate.c mm: rename deactivate_page to deactivate_file_page 2015-04-15 16:35:17 -07:00
util.c mm: uninline and cleanup page-mapping related helpers 2015-04-15 16:35:19 -07:00
vmacache.c mm,vmacache: count number of system-wide flushes 2014-12-13 12:42:48 -08:00
vmalloc.c mm/vmalloc: get rid of dirty bitmap inside vmap_block structure 2015-04-15 16:35:18 -07:00
vmpressure.c mm/vmpressure.c: fix race in vmpressure_work_fn() 2014-12-02 17:32:07 -08:00
vmscan.c mm: vmscan: reclaim highmem zone if buffer_heads is over limit 2016-05-17 13:42:49 -04:00
vmstat.c vmstat: Reduce time interval to stat update on idle cpu 2015-02-11 17:06:07 -08:00
workingset.c list_lru: add helpers to isolate items 2015-02-12 18:54:10 -08:00
zbud.c mm/zpool: add name argument to create zpool 2015-02-12 18:54:12 -08:00
zpool.c mm/zpool: add name argument to create zpool 2015-02-12 18:54:12 -08:00
zsmalloc.c zsmalloc: fix migrate_zspage-zs_free race condition 2016-02-03 16:23:21 -05:00
zswap.c mm/zpool: add name argument to create zpool 2015-02-12 18:54:12 -08:00