android_kernel_google_msm/Documentation
KAMEZAWA Hiroyuki 0d31021981 memcg: fix/change behavior of shared anon at moving task
This patch changes memcg's behavior at task_move().

At task_move(), the kernel scans a task's page table and move the changes
for mapped pages from source cgroup to target cgroup.  There has been a
bug at handling shared anonymous pages for a long time.

Before patch:
  - The spec says 'shared anonymous pages are not moved.'
  - The implementation was 'shared anonymoys pages may be moved'.
    If page_mapcount <=2, shared anonymous pages's charge were moved.

After patch:
  - The spec says 'all anonymous pages are moved'.
  - The implementation is 'all anonymous pages are moved'.

Considering usage of memcg, this will not affect user's experience.
'shared anonymous' pages only exists between a tree of processes which
don't do exec().  Moving one of process without exec() seems not sane.
For example, libcgroup will not be affected by this change.  (Anyway, no
one noticed the implementation for a long time...)

Below is a discussion log:

 - current spec/implementation are complex
 - Now, shared file caches are moved
 - It adds unclear check as page_mapcount(). To do correct check,
   we should check swap users, etc.
 - No one notice this implementation behavior. So, no one get benefit
   from the design.
 - In general, once task is moved to a cgroup for running, it will not
   be moved....
 - Finally, we have control knob as memory.move_charge_at_immigrate.

Here is a patch to allow moving shared pages, completely. This makes
memcg simpler and fix current broken code.

Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-01-01 22:02:04 +03:00
..
ABI UPSTREAM: zram: deprecate zram attrs sysfs nodes 2018-01-01 21:27:12 +03:00
accounting
acpi Update documentation for parameter *notrigger* in einj.txt 2012-03-30 03:30:19 -04:00
aoe Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
arm uio: msm_sharedmem: Add new device driver for sharedmemory access 2014-07-15 23:59:19 +00:00
auxdisplay
backlight backlight: new backlight driver for LP855x devices 2012-03-23 16:58:33 -07:00
blackfin
block block: Add test-iosched scheduler 2013-02-27 18:13:18 -08:00
blockdev UPSTREAM: zram: deprecate zram attrs sysfs nodes 2018-01-01 21:27:12 +03:00
cdrom
cgroups memcg: fix/change behavior of shared anon at moving task 2018-01-01 22:02:04 +03:00
connector
console
cpu-freq cpufreq: interactive: add boost pulse interface 2012-05-03 17:41:51 -07:00
cpuidle cpuidle: add a sysfs entry to disable specific C state for debug purpose. 2012-03-30 01:52:58 -04:00
cris
crypto crypto: Add MSM crypto drivers 2013-02-25 11:29:28 -08:00
development-process
device-mapper dm: verity fix documentation 2012-07-16 09:04:25 -07:00
devicetree Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
DocBook ALSA: Remove transfer_ack_{begin,end} callbacks from struct snd_pcm_runtime 2017-03-07 05:44:05 +00:00
driver-model Merge remote-tracking branches 'regulator/topic/devm' and 'regulator/topic/stub' into regulator-next 2012-03-18 21:38:28 +00:00
dvb Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
early-userspace
EDID drm: allow loading an EDID as firmware to override broken monitor 2012-03-20 10:09:28 +00:00
fault-injection
fb Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
filesystems BACKPORT: mm: /proc/pid/smaps:: show proportional swap share of the mapping 2017-12-27 22:48:40 +03:00
firmware_class firmware loader: document firmware cache mechanism 2017-12-28 12:57:14 +03:00
frv
hid HID: uhid: add documentation 2013-03-04 12:45:09 -08:00
hwmon hwmon: (coretemp) Add support for Atom CE4110/4150/4170 2014-04-14 06:44:31 -07:00
i2c i2c-piix4: Add AMD CZ SMBus device ID 2014-06-07 16:02:14 -07:00
i2o
ia64
ide Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
infiniband
input Documentation: input.txt: clarify mousedev 'cat' command syntax 2012-03-30 16:03:15 -07:00
ioctl Merge branch 'for-next' of git://gitorious.org/kernel-hsi/kernel-hsi 2012-04-02 09:50:40 -07:00
isdn Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
ja_JP Documentation: Update stable address in Chinese and Japanese translations 2014-06-07 16:02:02 -07:00
kbuild Documentation: mention scripts/diffconfig tool 2012-03-30 16:03:15 -07:00
kdump
ko_KR
laptops Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
leds drivers/leds/leds-lp5521.c: support led pattern data 2012-03-23 16:58:34 -07:00
m68k
make
mips
misc-devices
mmc mmc: use percentage changed sectors as indication to check BKOPS need 2013-03-15 17:08:16 -07:00
mn10300
mtd mtd: msm_qpic_nand: Initial driver for QPIC based NAND controller 2013-02-27 18:17:42 -08:00
namespaces
netlabel
networking Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
nfc
parisc
PCI
pcmcia
power Documentation: Point to correct header file 2013-02-25 11:36:56 -08:00
powerpc Documentation/powerpc/mpc52xx.txt: Checkpatch cleanup 2012-03-18 23:59:34 +01:00
pps
prctl Documentation: prctl/seccomp_filter 2014-10-31 19:46:17 -07:00
pti
ptp
rapidio
RCU
s390 Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
scheduler
scsi SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
security KEYS: Add invalidation support 2016-10-29 23:12:12 +08:00
serial Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
sh
sound Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sparc
spi
sysctl Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
target
telephony
thermal
timers time: Remove CONFIG_TIMER_STATS 2017-07-02 13:03:26 +03:00
trace Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
usb usb: misc: Add kickstart bridge driver 2013-02-27 18:19:01 -08:00
vDSO
video4linux Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
virtual Merge branch 'kvm-updates/3.4' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-03-28 14:35:31 -07:00
vm UPSTREAM: zsmalloc: zsmalloc documentation 2018-01-01 21:27:11 +03:00
w1
watchdog watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core 2012-03-27 20:15:37 +02:00
wimax
x86 x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack 2014-08-07 12:00:10 -07:00
zh_CN Documentation: Update stable address in Chinese and Japanese translations 2014-06-07 16:02:02 -07:00
.gitignore
00-INDEX crc32: move long comment about crc32 fundamentals to Documentation/ 2012-03-23 16:58:37 -07:00
android.txt [docs] android: Add android config documentation to boot framework. 2012-04-09 13:53:13 -07:00
applying-patches.txt
atomic_ops.txt
bad_memory.txt
basic_profiling.txt
binfmt_misc.txt
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
bus-virt-phys-mapping.txt
cachetlb.txt
Changes
circular-buffers.txt
clk.txt Documentation: common clk API 2012-03-16 20:35:01 +00:00
coccinelle.txt
CodingStyle Documentation: CodingStyle: add inline assembly guidelines 2012-03-30 16:03:15 -07:00
cpu-hotplug.txt documentation: remove references to cpu_*_map. 2012-03-29 15:38:31 +10:30
cpu-load.txt
cputopology.txt
crc32.txt crc32: move long comment about crc32 fundamentals to Documentation/ 2012-03-23 16:58:37 -07:00
csdio.txt mmc: Char SDIO Device Driver 2013-02-25 11:29:22 -08:00
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
DMA-attributes.txt common: DMA-mapping: Add strongly ordered memory attribute 2013-03-07 15:23:21 -08:00
dma-buf-sharing.txt dma-buf: mmap support 2012-05-22 14:01:06 -07:00
DMA-ISA-LPC.txt
dmaengine.txt
dontdiff Documentation: remove 'mach' from dontdiff file 2012-03-30 16:03:15 -07:00
dynamic-debug-howto.txt
edac.txt EDAC: Correct scrub rate API 2012-03-19 12:03:58 +01:00
eisa.txt
email-clients.txt
feature-removal-schedule.txt Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-05-14 11:23:37 -07:00
flexible-arrays.txt
futex-requeue-pi.txt
gcov.txt
genlock.txt base: genlock: allow synchronization with a single gralloc handle 2013-02-25 11:29:17 -08:00
gpio.txt
highuid.txt
HOWTO docs: update HOWTO for 2.6.x -> 3.x versioning 2012-06-01 15:18:18 +08:00
hw_random.txt
hwspinlock.txt
init.txt
initrd.txt
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt
kernel-docs.txt
kernel-parameters.txt Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
kmemcheck.txt
kmemleak.txt
kobject.txt
kprobes.txt
kref.txt
ldm.txt
local_ops.txt
lockdep-design.txt
lockstat.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lzo.txt Documentation: lzo: document part of the encoding 2015-02-02 17:04:43 +08:00
magic-number.txt
Makefile mm: move hugepage test examples to tools/testing/selftests/vm 2012-03-28 17:14:37 -07:00
ManagementStyle
mca.txt
md.txt
media-framework.txt
memory-barriers.txt
memory-hotplug.txt
memory.txt
mono.txt Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
mutex-design.txt
nommu-mmap.txt
numastat.txt
oops-tracing.txt
padata.txt
parport-lowlevel.txt
parport.txt Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
pi-futex.txt
pinctrl.txt pinctrl: fix example .get_group_pins implementation signature 2015-09-18 09:20:24 +08:00
pnp.txt
preempt-locking.txt
printk-formats.txt
prio_tree.txt
ramoops.txt
rbtree.txt
remoteproc.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
rt-mutex-design.txt
rt-mutex.txt
rtc.txt
SAK.txt
SecurityBugs
serial-console.txt
sgi-ioc4.txt
sgi-visws.txt
SM501.txt
sparse.txt
spinlocks.txt
stable_api_nonsense.txt
stable_kernel_rules.txt stable_kernel_rules: Add pointer to netdev-FAQ for network patches 2014-09-25 11:49:09 +08:00
static-keys.txt
SubmitChecklist
SubmittingDrivers
SubmittingPatches
svga.txt
sync.txt sync: add Documentation/sync.txt 2013-03-15 17:13:08 -07:00
sysfs-rules.txt
sysrq.txt Documentation: sysrq: Crutcher Dunnavant is unavailable 2012-03-30 16:03:15 -07:00
unaligned-memory-access.txt
unicode.txt
unshare.txt
VGA-softcursor.txt
vgaarbiter.txt
video-output.txt
volatile-considered-harmful.txt
workqueue.txt
xz.txt
zorro.txt