kernel_optimize_test/mm
Michal Hocko f5e03a4989 memcg, shmem: fix shmem migration to use lrucare
It has been reported that 965GM might trigger

  VM_BUG_ON_PAGE(!lrucare && PageLRU(oldpage), oldpage)

in mem_cgroup_migrate when shmem wants to replace a swap cache page
because of shmem_should_replace_page (the page is allocated from an
inappropriate zone).  shmem_replace_page expects that the oldpage is not
on LRU list and calls mem_cgroup_migrate without lrucare.  This is
obviously incorrect because swapcache pages might be on the LRU list
(e.g. swapin readahead page).

Fix this by enabling lrucare for the migration in shmem_replace_page.
Also clarify that lrucare should be used even if one of the pages might
be on LRU list.

The BUG_ON will trigger only when CONFIG_DEBUG_VM is enabled but even
without that the migration code might leave the old page on an
inappropriate memcg' LRU which is not that critical because the page
would get removed with its last reference but it is still confusing.

Fixes: 0a31bc97c8 ("mm: memcontrol: rewrite uncharge API")
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Dave Airlie <airlied@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@vger.kernel.org>	[3.17+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-05 13:35:29 -08:00
..
backing-dev.c
balloon_compaction.c
bootmem.c
cleancache.c
cma.c
compaction.c
debug-pagealloc.c
debug.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap_xip.c
filemap.c
fremap.c
frontswap.c
gup.c vm: add VM_FAULT_SIGSEGV handling support 2015-01-29 10:51:32 -08:00
highmem.c
huge_memory.c
hugetlb_cgroup.c
hugetlb.c
hwpoison-inject.c
init-mm.c
internal.h
interval_tree.c
iov_iter.c
Kconfig
Kconfig.debug mm/debug_pagealloc: remove obsolete Kconfig options 2015-01-08 15:10:52 -08:00
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c vm: add VM_FAULT_SIGSEGV handling support 2015-01-29 10:51:32 -08:00
list_lru.c
maccess.c
madvise.c
Makefile
memblock.c
memcontrol.c memcg, shmem: fix shmem migration to use lrucare 2015-02-05 13:35:29 -08:00
memory_hotplug.c
memory-failure.c
memory.c vm: make stack guard page errors return VM_FAULT_SIGSEGV rather than SIGBUS 2015-01-29 11:15:17 -08:00
mempolicy.c
mempool.c
migrate.c
mincore.c
mlock.c
mm_init.c
mmap.c mm: fix corner case in anon_vma endless growing prevention 2015-01-11 11:45:10 -08:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nobootmem.c
nommu.c mm: export "high_memory" symbol on !MMU 2015-02-05 13:35:29 -08:00
oom_kill.c
page_alloc.c mm: page_alloc: embed OOM killing naturally into allocation slowpath 2015-01-26 13:37:18 -08:00
page_counter.c
page_ext.c
page_io.c
page_isolation.c
page_owner.c
page-writeback.c
pagewalk.c mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range 2015-02-05 13:35:29 -08:00
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c
shmem.c memcg, shmem: fix shmem migration to use lrucare 2015-02-05 13:35:29 -08:00
slab_common.c
slab.c
slab.h
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap_cgroup.c
swap_state.c
swap.c
swapfile.c
truncate.c
util.c
vmacache.c
vmalloc.c
vmpressure.c
vmscan.c mm/vmscan: fix highidx argument type 2015-01-26 13:37:18 -08:00
vmstat.c
workingset.c
zbud.c
zpool.c
zsmalloc.c
zswap.c