ksm: introduce ksm_max_page_sharing per page deduplication limit
Andrea Arcangeli authored
Without a max deduplication limit for each KSM page, the list of the
rmap_items associated to each stable_node can grow infinitely large.

During the rmap walk each entry can take up to ~10usec to process
because of IPIs for the TLB flushing (both for the primary MMU and the
secondary MMUs with the MMU notifier).  With only 16GB of address space
shared in the same KSM page, that would amount to dozens of seconds of
kernel runtime.

A ~256 max deduplication factor will reduce the latencies of the rmap
walks on KSM pages to order of a few msec.  Just doing the
cond_resched() during the rmap walks is not enough, the list size must
have a limit too, otherwise the caller could get blocked in (schedule
friendly) kernel computations for seconds, unexpectedly.

There's room for optimization to significantly reduce the IPI delivery
cost during the page_referenced(), but at least for page_migration in
the KSM case (used by hard NUMA bindings, compacti...
2c653d0e
Name Last commit Last update
Documentation ksm: introduce ksm_max_page_sharing per page deduplication limit
arch tile: provide default ioremap declaration
block Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
certs scripts/spelling.txt: add "intialise(d)" pattern and fix typo instances
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
drivers mm, sparsemem: break out of loops early
firmware firmware/Makefile: force recompilation if makefile changes
fs fs/file.c: replace alloc_fdmem() with kvmalloc() alternative
include mm, sparsemem: break out of loops early
init mm: allow slab_nomerge to be set at build time
ipc mm: introduce kv[mz]alloc helpers
kernel kernel/module.c: use linux/set_memory.h
lib Merge branch 'for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
mm ksm: introduce ksm_max_page_sharing per page deduplication limit
net Merge branch 'work.memdup_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
samples bpf: fix return in load_bpf_file
scripts scripts/spelling.txt: add a bunch more spelling mistakes
security Merge branch 'work.memdup_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
sound Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
usr ramfs: clarify help text that compression applies to ramfs as well as legacy ramdisk.
virt Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore kbuild: Add support to generate LLVM assembly files
.mailmap Merge tag 'for-v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
COPYING [PATCH] update FSF address in COPYING
CREDITS avr32: remove support for AVR32 architecture
Kbuild kbuild: Consolidate header generation from ASM offset information
Kconfig kbuild: migrate all arch to the kconfig mainmenu upgrade
MAINTAINERS Merge branch 'for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Makefile Merge tag 'docs-4.13' of git://git.lwn.net/linux
README README: add a new README file, pointing to the Documentation/
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.