linux-sg2042/Documentation
Shakeel Butt b603894248 mm: memcg: add swapcache stat for memcg v2
This patch adds swapcache stat for the cgroup v2.  The swapcache
represents the memory that is accounted against both the memory and the
swap limit of the cgroup.  The main motivation behind exposing the
swapcache stat is for enabling users to gracefully migrate from cgroup
v1's memsw counter to cgroup v2's memory and swap counters.

Cgroup v1's memsw limit allows users to limit the memory+swap usage of a
workload but without control on the exact proportion of memory and swap.
Cgroup v2 provides separate limits for memory and swap which enables more
control on the exact usage of memory and swap individually for the
workload.

With some little subtleties, the v1's memsw limit can be switched with the
sum of the v2's memory and swap limits.  However the alternative for memsw
usage is not yet available in cgroup v2.  Exposing per-cgroup swapcache
stat enables that alternative.  Adding the memory usage and swap usage and
subtracting the swapcache will approximate the memsw usage.  This will
help in the transparent migration of the workloads depending on memsw
usage and limit to v2' memory and swap counters.

The reasons these applications are still interested in this approximate
memsw usage are: (1) these applications are not really interested in two
separate memory and swap usage metrics.  A single usage metric is more
simple to use and reason about for them.

(2) The memsw usage metric hides the underlying system's swap setup from
the applications.  Applications with multiple instances running in a
datacenter with heterogeneous systems (some have swap and some don't) will
keep seeing a consistent view of their usage.

[akpm@linux-foundation.org: fix CONFIG_SWAP=n build]

Link: https://lkml.kernel.org/r/20210108155813.2914586-3-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Roman Gushchin <guro@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Yang Shi <shy828301@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-02-24 13:38:29 -08:00
..
ABI Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-02-23 14:56:23 -08:00
PCI
RCU It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
accounting Documentation: Replace lkml.org links with lore 2021-01-11 12:47:38 -07:00
admin-guide mm: memcg: add swapcache stat for memcg v2 2021-02-24 13:38:29 -08:00
arm Documentation: ARM: fix reference to DT format documentation 2021-01-28 15:37:43 -07:00
arm64 ARM: 2020-12-20 10:44:05 -08:00
block MMC core: 2021-02-22 09:05:28 -08:00
bpf bpf, docs: Update build procedure for manually compiling LLVM and Clang 2021-01-23 00:09:03 +01:00
cdrom
core-api atomic: remove further references to atomic_ops 2020-12-31 15:51:33 -07:00
cpu-freq
crypto crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
dev-tools linux-kselftest-kunit-5.12-rc1 2021-02-22 11:03:00 -08:00
devicetree dmaengine updates for v5.12-rc1 2021-02-23 15:05:10 -08:00
doc-guide docs: Document cross-referencing using relative path 2021-02-04 16:24:12 -07:00
driver-api It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
fault-injection
fb
features ARM updates for 5.11: 2020-12-22 13:34:27 -08:00
filesystems idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
firmware-guide Merge branch 'acpi-messages' 2021-02-15 17:04:53 +01:00
firmware_class
fpga
gpu It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
hid Documentation: HID: uhid editing & corrections 2021-01-04 11:50:39 +01:00
hwmon hwmon: add Texas Instruments TPS23861 driver 2021-02-12 07:02:55 -08:00
i2c i2c: testunit: add support for block process calls 2021-02-12 11:11:04 +01:00
ia64
ide
iio docs: iio: Correct a typo 2021-01-21 14:06:00 -07:00
infiniband
input Documentation: input: define ABS_PRESSURE/ABS_MT_PRESSURE resolution as grams 2021-01-28 16:43:04 -07:00
isdn
kbuild SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
kernel-hacking docs: kernel-hacking: be more civil 2021-02-11 10:00:40 -07:00
leds Changes for 5.11-rc1. Small cleanups/fixes mostly thanks to Marek, 2020-12-16 14:56:29 -08:00
litmus-tests
livepatch Documentation: livepatch: document reliable stacktrace 2021-01-26 11:50:00 +01:00
locking
m68k
maintainer
mhi
mips
misc-devices
netlabel
networking Staging/IIO driver patches for 5.12-rc1 2021-02-20 21:36:51 -08:00
nios2
nvdimm
openrisc
parisc
pcmcia
power It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
powerpc
process It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
riscv
s390
scheduler It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
scsi SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
security Keyrings miscellany 2021-02-23 16:09:23 -08:00
sh
sound ALSA: jack: implement software jack injection via debugfs 2021-02-02 10:37:07 +01:00
sparc
sphinx docs: Enable usage of relative paths to docs on automarkup 2021-02-04 16:23:43 -07:00
sphinx-static
spi
staging
target
timers Documentation: Replace lkml.org links with lore 2021-01-11 12:47:38 -07:00
trace tracing: Add ptr-hash option to show the hashed pointer value 2021-02-11 16:31:57 -05:00
translations It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
usb usb: raw-gadget: update documentation and Kconfig 2021-01-26 18:38:45 +01:00
userspace-api SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
virt s390 updates for the 5.12 merge window 2021-02-21 13:40:06 -08:00
vm mm/debug_vm_pgtable/basic: add validation for dirtiness after write protect 2021-02-24 13:38:27 -08:00
w1
watchdog
x86 Documentation/x86/boot.rst: Correct the example of SETUP_INDIRECT 2021-01-28 15:25:31 -07:00
xtensa A much quieter cycle for documentation (happily), with, one hopes, the bulk 2020-12-14 16:55:54 -08:00
.gitignore
COPYING-logo
Changes
CodingStyle
Kconfig
Makefile kbuild: remove PYTHON variable 2021-02-01 10:37:19 +09:00
SubmittingPatches
asm-annotations.rst x86/entry: Emit a symbol for register restoring thunk 2021-01-14 17:18:25 +01:00
atomic_bitops.txt
atomic_t.txt
conf.py Move our minimum Sphinx version to 1.7 2021-02-01 16:29:12 -07:00
docutils.conf
dontdiff
index.rst docs: Include ext4 documentation via filesystems/ 2021-01-11 13:01:51 -07:00
logo.gif
memory-barriers.txt
watch_queue.rst