No description
Find a file
Johannes Weiner fad0459461 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-04-19 18:00:22 +08:00
arch mips: fix syscall_get_nr 2023-04-19 18:00:22 +08:00
block block: don't allow multiple bios for IOCB_NOWAIT issue 2023-04-19 18:00:13 +08:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2023-04-19 17:50:34 +08:00
crypto crypto: rsa-pkcs1pad - Use akcipher_request_complete 2023-04-19 17:59:48 +08:00
Documentation mm: memcontrol: deprecate charge moving 2023-04-19 18:00:22 +08:00
drivers remoteproc/mtk_scp: Move clk ops outside send_lock 2023-04-19 18:00:22 +08:00
fs ceph: update the time stamps and try to drop the suid/sgid 2023-04-19 18:00:22 +08:00
include ima: Align ima_file_mmap() parameters with mmap_file LSM hook 2023-04-19 18:00:18 +08:00
init kbuild: Add CONFIG_PAHOLE_VERSION 2023-04-19 17:59:33 +08:00
io_uring io_uring/poll: allow some retries for poll triggering spuriously 2023-04-19 18:00:19 +08:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2023-04-19 17:56:54 +08:00
kernel dax/kmem: Fix leak of memory-hotplug resources 2023-04-19 18:00:22 +08:00
lib kobject: Fix slab-out-of-bounds in fill_kobj_path() 2023-04-19 18:00:00 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm mm: memcontrol: deprecate charge moving 2023-04-19 18:00:22 +08:00
net wifi: cfg80211: Fix use after free for wext 2023-04-19 18:00:21 +08:00
samples samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe() 2023-04-19 17:57:46 +08:00
scripts builddeb: clean generated package content 2023-04-19 18:00:06 +08:00
security ima: Align ima_file_mmap() parameters with mmap_file LSM hook 2023-04-19 18:00:18 +08:00
sound ALSA: hda/realtek: Add quirk for HP EliteDesk 800 G6 Tower PC 2023-04-19 18:00:20 +08:00
tools selftests/landlock: Test ptrace as much as possible with Yama 2023-04-19 18:00:16 +08:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2023-04-19 17:44:58 +08:00
virt KVM: Destroy target device if coalesced MMIO unregistration fails 2023-04-19 18:00:17 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS kbuild: Add CONFIG_PAHOLE_VERSION 2023-04-19 17:59:33 +08:00
Makefile Linux 5.15.98 2023-04-19 17:59:36 +08:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

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.