linux/mm
Vladimir Davydov cdcbb72ebf mm: workingset: size shadow nodes lru basing on file cache size
A page is activated on refault if the refault distance stored in the
corresponding shadow entry is less than the number of active file pages.
Since active file pages can't occupy more than half memory, we assume
that the maximal effective refault distance can't be greater than half
the number of present pages and size the shadow nodes lru list
appropriately.  Generally speaking, this assumption is correct, but it
can result in wasting a considerable chunk of memory on stale shadow
nodes in case the portion of file pages is small, e.g.  if a workload
mostly uses anonymous memory.

To sort this out, we need to compute the size of shadow nodes lru basing
not on the maximal possible, but the current size of file cache.  We
could take the size of active file lru for the maximal refault distance,
but active lru is pretty unstable - it can shrink dramatically at
runtime possibly disrupting workingset detection logic.

Instead we assume that the maximal refault distance equals half the
total number of file cache pages.  This will protect us against active
file lru size fluctuations while still being correct, because size of
active lru is normally maintained lower than size of inactive lru.

Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-17 15:09:34 -07:00
..
kasan kasan: add functions to clear stack poison 2016-03-09 15:43:42 -08:00
backing-dev.c mm/backing-dev.c: fix error path in wb_init() 2016-02-11 18:35:48 -08:00
balloon_compaction.c
bootmem.c
cleancache.c
cma.c
cma.h
cma_debug.c
compaction.c mm, kswapd: replace kswapd compaction with waking up kcompactd 2016-03-17 15:09:34 -07:00
debug.c mm, debug: move bad flags printing to bad_page() 2016-03-15 16:55:16 -07:00
dmapool.c
early_ioremap.c
fadvise.c
failslab.c mm: fault-inject take over bootstrap kmem_cache check 2016-03-15 16:55:16 -07:00
filemap.c mm: remove unnecessary uses of lock_page_memcg() 2016-03-15 16:55:16 -07:00
frame_vector.c
frontswap.c
gup.c
highmem.c
huge_memory.c thp: cleanup split_huge_page() 2016-03-15 16:55:16 -07:00
hugetlb.c mm/hugetlb: use EOPNOTSUPP in hugetlb sysctl handlers 2016-03-09 15:43:42 -08:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h mm, kswapd: replace kswapd compaction with waking up kcompactd 2016-03-17 15:09:34 -07:00
interval_tree.c
Kconfig mm/Kconfig: correct description of DEFERRED_STRUCT_PAGE_INIT 2016-02-05 18:10:40 -08:00
Kconfig.debug mm/page_poisoning.c: allow for zero poisoning 2016-03-15 16:55:16 -07:00
kmemcheck.c mm: kmemcheck skip object if slab allocation failed 2016-03-15 16:55:16 -07:00
kmemleak-test.c
kmemleak.c
ksm.c
list_lru.c
maccess.c
madvise.c mm/madvise: update comment on sys_madvise() 2016-03-15 16:55:16 -07:00
Makefile mm/page_poison.c: enable PAGE_POISONING as a separate option 2016-03-15 16:55:16 -07:00
memblock.c mm/memblock.c: remove unnecessary memblock_type variable 2016-03-15 16:55:16 -07:00
memcontrol.c mm: memcontrol: zap memcg_kmem_online helper 2016-03-17 15:09:34 -07:00
memory-failure.c mm/memory-failure.c: remove useless "undef"s 2016-03-15 16:55:16 -07:00
memory.c Merge branch 'akpm' (patches from Andrew) 2016-03-16 11:51:08 -07:00
memory_hotplug.c mm, memory hotplug: small cleanup in online_pages() 2016-03-17 15:09:34 -07:00
mempolicy.c mm/mempolicy.c: skip VM_HUGETLB and VM_MIXEDMAP VMA for lazy mbind 2016-03-15 16:55:16 -07:00
mempool.c mm/mempool: avoid KASAN marking mempool poison checks as use-after-free 2016-03-11 16:17:47 -08:00
memtest.c
migrate.c mm: migrate: consolidate mem_cgroup_migrate() calls 2016-03-15 16:55:16 -07:00
mincore.c
mlock.c
mm_init.c
mmap.c Linux 4.5-rc7 2016-03-07 09:27:30 +01:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c mm, dax: check for pmd_none() after split_huge_pmd() 2016-02-11 18:35:48 -08:00
mremap.c mm, dax: check for pmd_none() after split_huge_pmd() 2016-02-11 18:35:48 -08:00
msync.c
nobootmem.c
nommu.c
oom_kill.c mm: oom_kill: don't ignore oom score on exiting tasks 2016-03-17 15:09:34 -07:00
page-writeback.c mm: remove unnecessary uses of lock_page_memcg() 2016-03-15 16:55:16 -07:00
page_alloc.c mm, compaction: introduce kcompactd 2016-03-17 15:09:34 -07:00
page_counter.c
page_ext.c mm/page_poisoning.c: allow for zero poisoning 2016-03-15 16:55:16 -07:00
page_idle.c
page_io.c
page_isolation.c
page_owner.c mm, page_owner: dump page owner info from dump_page() 2016-03-15 16:55:16 -07:00
page_poison.c mm/page_poisoning.c: allow for zero poisoning 2016-03-15 16:55:16 -07:00
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c mm,thp: fix spellos in describing __HAVE_ARCH_FLUSH_PMD_TLB_RANGE 2016-02-11 18:35:48 -08:00
process_vm_access.c
quicklist.c
readahead.c
rmap.c mm: simplify lock_page_memcg() 2016-03-15 16:55:16 -07:00
shmem.c mm: migrate: do not touch page->mem_cgroup of live pages 2016-03-15 16:55:16 -07:00
slab.c mm: memcontrol: report slab usage in cgroup2 memory.stat 2016-03-17 15:09:34 -07:00
slab.h mm: memcontrol: report slab usage in cgroup2 memory.stat 2016-03-17 15:09:34 -07:00
slab_common.c mm: memcontrol: zap memcg_kmem_online helper 2016-03-17 15:09:34 -07:00
slob.c mm: slab: free kmem_cache_node after destroy sysfs file 2016-02-18 16:23:24 -08:00
slub.c mm/slub: query dynamic DEBUG_PAGEALLOC setting 2016-03-17 15:09:34 -07:00
sparse-vmemmap.c
sparse.c
swap.c
swap_cgroup.c
swap_state.c
swapfile.c
truncate.c mm: remove unnecessary uses of lock_page_memcg() 2016-03-15 16:55:16 -07:00
userfaultfd.c
util.c
vmacache.c
vmalloc.c mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting 2016-03-17 15:09:34 -07:00
vmpressure.c
vmscan.c mm: vmscan: pass root_mem_cgroup instead of NULL to memcg aware shrinker 2016-03-17 15:09:34 -07:00
vmstat.c mm, compaction: introduce kcompactd 2016-03-17 15:09:34 -07:00
workingset.c mm: workingset: size shadow nodes lru basing on file cache size 2016-03-17 15:09:34 -07:00
zbud.c
zpool.c
zsmalloc.c
zswap.c