WSL2-Linux-Kernel/Documentation
Ganesan Rajagopal 8e20d4b332 mm/memcontrol: export memcg->watermark via sysfs for v2 memcg
We run a lot of automated tests when building our software and run into
OOM scenarios when the tests run unbounded.  v1 memcg exports
memcg->watermark as "memory.max_usage_in_bytes" in sysfs.  We use this
metric to heuristically limit the number of tests that can run in parallel
based on per test historical data.

This metric is currently not exported for v2 memcg and there is no other
easy way of getting this information.  getrusage() syscall returns
"ru_maxrss" which can be used as an approximation but that's the max RSS
of a single child process across all children instead of the aggregated
max for all child processes.  The only work around is to periodically poll
"memory.current" but that's not practical for short-lived one-off cgroups.

Hence, expose memcg->watermark as "memory.peak" for v2 memcg.

Link: https://lkml.kernel.org/r/20220507050916.GA13577@us192.sjc.aristanetworks.com
Signed-off-by: Ganesan Rajagopal <rganesan@arista.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-05-13 16:48:57 -07:00
..
ABI Docs/{ABI,admin-guide}/damon: Update for 'state' sysfs file input keyword, 'commit' 2022-05-13 07:20:09 -07:00
PCI PCI/doc: cleanup references to the legacy PCI DMA API 2022-03-30 16:54:24 +02:00
RCU
accounting
admin-guide mm/memcontrol: export memcg->watermark via sysfs for v2 memcg 2022-05-13 16:48:57 -07:00
arc
arm
arm64
block
bpf docs: netdev: move the netdev-FAQ to the process pages 2022-03-31 10:49:39 +02:00
cdrom
core-api XArray update for 5.18: 2022-04-01 13:40:44 -07:00
cpu-freq
crypto
dev-tools kasan: move boot parameters section in documentation 2022-05-13 07:20:19 -07:00
devicetree Networking fixes for 5.18-rc5, including fixes from bluetooth, bpf 2022-04-28 12:34:50 -07:00
doc-guide
driver-api Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes 2022-04-05 11:39:22 +02:00
fault-injection
fb
features
filesystems doc: update documentation for swap_activate and swap_rw 2022-05-09 18:20:48 -07:00
firmware-guide Merge branch 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2022-03-26 12:46:08 -07:00
firmware_class
fpga
gpu pci-v5.18-changes 2022-03-25 13:02:05 -07:00
hid
hwmon Char/Misc and other driver updates for 5.18-rc1 2022-03-28 12:27:35 -07:00
i2c
ia64
ide
iio
infiniband
input
isdn
kbuild kbuild: Make $(LLVM) more flexible 2022-03-31 12:03:46 +09:00
kernel-hacking
leds
litmus-tests
livepatch
locking Documentation: Fix duplicate statement about raw_spinlock_t type 2022-03-25 13:30:08 -06:00
m68k
maintainer Some late-arriving documentation improvements. This is mostly build-system 2022-03-31 12:10:42 -07:00
mhi
mips
misc-devices
netlabel
networking doc/ip-sysctl: add bc_forwarding 2022-04-20 10:31:43 +01:00
nios2
nvdimm
openrisc
parisc
pcmcia
peci
power
powerpc
process docs: netdev: move the netdev-FAQ to the process pages 2022-03-31 10:49:39 +02:00
riscv Documentation: riscv: remove non-existent directory from table of contents 2022-03-31 16:18:56 -07:00
s390
scheduler
scsi
security
sh
sound
sparc
sphinx docs: sphinx/requirements: Limit jinja2<3.1 2022-03-30 13:44:54 -06:00
sphinx-static
spi
staging
target
timers
tools
trace Updates to Tracing: 2022-04-03 12:26:01 -07:00
translations Kbuild -std=gnu11 updates for v5.18 2022-03-25 11:48:01 -07:00
tty
usb
userspace-api platform-drivers-x86 for v5.18-1 2022-03-25 12:14:39 -07:00
virt Documentation: KVM: Add SPDX-License-Identifier tag 2022-04-11 13:28:56 -04:00
vm Documentation/vm: rework "Temporary Virtual Mappings" section 2022-05-13 16:48:55 -07:00
w1
watchdog
x86 - More noinstr fixes 2022-03-25 12:34:53 -07:00
xtensa
.gitignore
COPYING-logo
Changes
CodingStyle
Kconfig
Makefile
SubmittingPatches
arch.rst
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt
conf.py
docutils.conf
dontdiff
index.rst
logo.gif
memory-barriers.txt
watch_queue.rst