mm: fix rss count leakage during migration
Konstantin Khlebnikov authored
Memory migration fills a pte with a migration entry and it doesn't
update the rss counters.  Then it replaces the migration entry with the
new page (or the old one if migration failed).  But between these two
passes this pte can be unmaped, or a task can fork a child and it will
get a copy of this migration entry.  Nobody accounts for this in the rss
counters.

This patch properly adjust rss counters for migration entries in
zap_pte_range() and copy_one_pte().  Thus we avoid extra atomic
operations on the migration fast-path.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
9f9f1acd
Name Last commit Last update
..
Kconfig Merge branch 'master' into x86/memblock
Kconfig.debug mm: more intensive memory corruption debugging
Makefile Cross Memory Attach
backing-dev.c freezer: implement and use kthread_freezable_should_stop()
bootmem.c mm: bootmem: try harder to free pages in bulk
bounce.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
cleancache.c mm: cleancache core ops functions and config
compaction.c mm: compaction: introduce sync-light migration for use by compaction
debug-pagealloc.c mm, x86: Remove debug_pagealloc_enabled
dmapool.c mm: fix implicit stat.h usage in dmapool.c
fadvise.c fadvise: only initiate writeback for specified range with FADV_DONTNEED
failslab.c switch debugfs to umode_t
filemap.c memcg: add mem_cgroup_replace_page_cache() to fix LRU issue
filemap_xip.c mm: Map most files to use export.h instead of module.h
fremap.c mm: delete various needless include <linux/module.h>
highmem.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
huge_memory.c memcg: fix split_huge_page_refcounts()
hugetlb.c mm/hugetlb.c: undo change to page mapcount in fault handler
hwpoison-inject.c Fix common misspellings
init-mm.c atomic: use <linux/atomic.h>
internal.h mm: thp: tail page refcounting fix
kmemcheck.c kmemcheck: add hooks for the page allocator
kmemleak-test.c kmemleak: remove memset by using kzalloc
kmemleak.c kmemleak: Add support for memory hotplug
ksm.c memcg: clear pc->mem_cgroup if necessary.
maccess.c mm: Map most files to use export.h instead of module.h
madvise.c fs: kill i_alloc_sem
memblock.c memblock: Reimplement memblock allocation using reverse free area iterator
memcontrol.c mm: memcg: update the correct soft limit tree during migration
memory-failure.c mm: compaction: introduce sync-light migration for use by compaction
memory.c mm: fix rss count leakage during migration
memory_hotplug.c mm: compaction: introduce sync-light migration for use by compaction
mempolicy.c mm: compaction: introduce sync-light migration for use by compaction
mempool.c mempool: fix first round failure behavior
migrate.c mm: compaction: introduce sync-light migration for use by compaction
mincore.c mm: clarify the radix_tree exceptional cases
mlock.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
mm_init.c mm: Map most files to use export.h instead of module.h
mmap.c mm: simplify find_vma_prev()
mmu_context.c mm: Map most files to use export.h instead of module.h
mmu_notifier.c mm: Map most files to use export.h instead of module.h
mmzone.c mm: delete various needless include <linux/module.h>
mprotect.c thp: mprotect: transparent huge page support
mremap.c mremap: enforce rmap src/dst vma ordering in case of vma_merge() succeeding in copy_vma()
msync.c sanitize vfs_fsync calling conventions
nobootmem.c Merge branch 'master' into x86/memblock
nommu.c xen: map foreign pages for shared rings by updating the PTEs directly
oom_kill.c mm: unify remaining mem_cont, mem, etc. variable names to memcg
page-writeback.c Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux
page_alloc.c mm: __count_immobile_pages(): make sure the node is online
page_cgroup.c
page_io.c
page_isolation.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
prio_tree.c
process_vm_access.c
quicklist.c
readahead.c
rmap.c
shmem.c
slab.c
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
truncate.c
util.c
vmalloc.c
vmscan.c
vmstat.c