linux-stable/Documentation
Johannes Weiner e6d20325f4 mm: memcontrol: deprecate charge moving
commit da34a8484d upstream.

Charge moving mode in cgroup1 allows memory to follow tasks as they
migrate between cgroups.  This is, and always has been, a questionable
thing to do - for several reasons.

First, it's expensive.  Pages need to be identified, locked and isolated
from various MM operations, and reassigned, one by one.

Second, it's unreliable.  Once pages are charged to a cgroup, there isn't
always a clear owner task anymore.  Cache isn't moved at all, for example.
Mapped memory is moved - but if trylocking or isolating a page fails,
it's arbitrarily left behind.  Frequent moving between domains may leave a
task's memory scattered all over the place.

Third, it isn't really needed.  Launcher tasks can kick off workload tasks
directly in their target cgroup.  Using dedicated per-workload groups
allows fine-grained policy adjustments - no need to move tasks and their
physical pages between control domains.  The feature was never
forward-ported to cgroup2, and it hasn't been missed.

Despite it being a niche usecase, the maintenance overhead of supporting
it is enormous.  Because pages are moved while they are live and subject
to various MM operations, the synchronization rules are complicated.
There are lock_page_memcg() in MM and FS code, which non-cgroup people
don't understand.  In some cases we've been able to shift code and cgroup
API calls around such that we can rely on native locking as much as
possible.  But that's fragile, and sometimes we need to hold MM locks for
longer than we otherwise would (pte lock e.g.).

Mark the feature deprecated. Hopefully we can remove it soon.

And backport into -stable kernels so that people who develop against
earlier kernels are warned about this deprecation as early as possible.

[akpm@linux-foundation.org: fix memory.rst underlining]
Link: https://lkml.kernel.org/r/Y5COd+qXwk/S+n8N@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-11 16:40:04 +01:00
..
ABI docs: Fix path paste-o for /sys/kernel/warn_count 2023-02-01 08:23:21 +01:00
accounting psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-05 12:37:55 +01:00
admin-guide mm: memcontrol: deprecate charge moving 2023-03-11 16:40:04 +01:00
arm ARM: 9012/1: move device tree mapping out of linear region 2021-05-19 10:13:18 +02:00
arm64 arm64: errata: Remove AES hwcap for COMPAT tasks 2022-10-30 09:41:16 +01:00
block
bpf
cdrom
core-api Revert "swiotlb: fix info leak with DMA_FROM_DEVICE" 2022-05-25 09:17:55 +02:00
cpu-freq
crypto
dev-tools docs/scripts/gdb: add necessary make scripts_gdb step 2023-03-11 16:39:52 +01:00
devicetree ASoC: dt-bindings: meson: fix gx-card codec node regex 2023-03-11 16:39:36 +01:00
doc-guide
driver-api spi: Update reference to struct spi_controller 2023-01-14 10:15:26 +01:00
fault-injection debugfs: fix error when writing negative value to atomic_t debugfs file 2023-01-14 10:15:19 +01:00
fb
features
filesystems ext4, doc: fix incorrect h_reserved size 2022-04-27 13:53:57 +02:00
firmware-guide Documentation: ACPI: EINJ: Fix obsolete example 2022-08-25 11:37:53 +02:00
firmware_class
fpga
gpu Revert "fbcon: Disable accelerated scrolling" 2022-02-08 18:30:40 +01:00
hid
hwmon hwmon: (lm90) Add basic support for TI TMP461 2021-12-29 12:25:59 +01:00
i2c
ia64
ide
iio
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-09-20 12:38:32 +02:00
isdn
kbuild Documentation/Kbuild: Remove references to gcc-plugin.sh 2021-12-14 11:32:46 +01:00
kernel-hacking
leds
litmus-tests
livepatch
locking Documentation/locking/locktypes: Update migrate_disable() bits. 2021-12-14 11:32:42 +01:00
m68k
maintainer
mhi
mips
misc-devices
netlabel
networking Documentation: fix sctp_wmem in ip-sysctl.rst 2022-08-03 12:00:47 +02:00
nios2
nvdimm
openrisc
parisc
PCI
pcmcia
power
powerpc powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls 2021-05-26 12:06:53 +02:00
process docs: update mediator contact information in CoC doc 2022-11-25 17:45:53 +01:00
RCU
riscv
s390
scheduler
scsi scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-03-25 09:04:11 +01:00
security
sh
sound ALSA: hda/realtek: Add alc256-samsung-headphone fixup 2022-04-08 14:40:36 +02:00
sparc
sphinx docs: Fix the docs build with Sphinx 6.0 2023-01-18 11:44:53 +01:00
sphinx-static
spi
staging
target tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
timers
trace tracing/histogram: Update document for KEYS_MAX size 2022-11-10 18:14:26 +01:00
translations
usb
userspace-api media: hevc: Fix dependent slice segment flags 2021-07-14 16:55:51 +02:00
virt KVM: s390: disable migration mode when dirty tracking is disabled 2023-03-11 16:39:58 +01:00
vm arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
w1
watchdog
x86
xtensa
.gitignore
asm-annotations.rst
atomic_bitops.txt locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-25 11:38:10 +02:00
atomic_t.txt
Changes
CodingStyle
conf.py docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 2022-06-09 10:21:28 +02:00
COPYING-logo
docutils.conf
dontdiff kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
index.rst
Kconfig
logo.gif
Makefile
memory-barriers.txt
SubmittingPatches
watch_queue.rst