android_kernel_google_msm/mm
Satoru Moriya 5ebc63e913 mm: avoid swapping out with swappiness==0
commit fe35004fbf upstream.

Sometimes we'd like to avoid swapping out anonymous memory.  In
particular, avoid swapping out pages of important process or process
groups while there is a reasonable amount of pagecache on RAM so that we
can satisfy our customers' requirements.

OTOH, we can control how aggressive the kernel will swap memory pages with
/proc/sys/vm/swappiness for global and
/sys/fs/cgroup/memory/memory.swappiness for each memcg.

But with current reclaim implementation, the kernel may swap out even if
we set swappiness=0 and there is pagecache in RAM.

This patch changes the behavior with swappiness==0.  If we set
swappiness==0, the kernel does not swap out completely (for global reclaim
until the amount of free pages and filebacked pages in a zone has been
reduced to something very very small (nr_free + nr_filebacked < high
watermark)).

Change-Id: Ibb357f534711e73838bca037bed7532bbf4d2728
Signed-off-by: Satoru Moriya <satoru.moriya@hds.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-29 23:12:33 +08:00
..
backing-dev.c
bootmem.c mm: sparse: fix usemap allocation above node descriptor section 2016-10-29 23:12:12 +08:00
bounce.c
cleancache.c
compaction.c cma: fix watermark checking 2013-03-15 17:06:38 -07:00
debug-pagealloc.c
dmapool.c
fadvise.c
failslab.c
filemap.c fs: introduce inode operation ->update_time 2015-07-13 11:17:49 -07:00
filemap_xip.c fs: introduce inode operation ->update_time 2015-07-13 11:17:49 -07:00
fremap.c
highmem.c
huge_memory.c
hugetlb.c
hwpoison-inject.c
init-mm.c
internal.h cma: fix watermark checking 2013-03-15 17:06:38 -07:00
Kconfig
Kconfig.debug
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c ksm: Provide support to use deferred timers for scanner thread 2016-10-29 23:12:17 +08:00
maccess.c
madvise.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
Makefile
memblock.c
memcontrol.c
memory-failure.c
memory.c mm: Use correct define for CMA features 2013-03-07 15:23:58 -08:00
memory_hotplug.c
mempolicy.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mempool.c
migrate.c
mincore.c
mlock.c mm: reorder can_do_mlock to fix audit denial 2015-06-16 23:08:46 -07:00
mm_init.c
mmap.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c mm: add a field to store names for private anonymous memory 2013-10-11 10:02:06 -07:00
mremap.c
msync.c
nobootmem.c
nommu.c
oom_kill.c mm, oom: make dump_tasks public 2014-11-18 15:13:25 -08:00
page-writeback.c mm: fix calculation of dirtyable memory 2016-10-29 23:12:16 +08:00
page_alloc.c mm: workaround for widevine playback failed 2013-05-22 07:57:36 +00:00
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 mm: change initial readahead window size calculation 2016-10-29 23:12:18 +08:00
rmap.c
shmem.c
slab.c
slob.c
slub.c slub: fix a memory leak in get_partial_node() 2013-03-15 17:09:26 -07:00
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
truncate.c
util.c nick kvfree() from apparmor 2014-11-18 15:13:23 -08:00
vmalloc.c
vmscan.c mm: avoid swapping out with swappiness==0 2016-10-29 23:12:33 +08:00
vmstat.c mm: make counts of CMA free pages correct 2013-03-07 15:23:58 -08:00