Skip to content

RFC Introduce memory allocation speed throttle in memcg

[email protected] cgroups linux-mm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7mm: record total charge and max speed counter in memcginclude/linux/page_counter.h init/Kconfig mm/memcontrol.c +1 more+93 -00 replies
2/7mm: introduce alloc_bps to memcg for memory allocation speed throttleinclude/linux/memcontrol.h mm/memcontrol.c+48 -00 replies
3/7mm: memory allocation speed throttle setup in hierarchyinclude/linux/memcontrol.h mm/memcontrol.c+50 -10 replies
4/7mm: introduce slice analysis into memory speed throttle mechanisminclude/linux/memcontrol.h mm/memcontrol.c+29 -00 replies
5/7mm: introduce memory allocation speed throttleinclude/linux/memcontrol.h mm/memcontrol.c+99 -50 replies
6/7mm: record the numbers of memory allocation throttleinclude/linux/memcontrol.h mm/memcontrol.c+30 -50 replies
7/7mm: introduce mst low and min watermarkinclude/linux/memcontrol.h mm/memcontrol.c+36 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/7] Introduce memory allocation speed throttle in memcg

From: Yulei Zhang <[email protected]>

In this patch set we present the idea to suppress the memory allocation speed in memory cgroup, which aims to avoid direct reclaim caused by memory allocation burst while under memory pressure.

As minimum watermark could be easily broken if certain tasks allocate massive amount of memory in a short period of time, in that case it will trigger the direct memory reclaim and cause unacceptable jitters for latency critical tasks, such as guaranteed pod task in K8s.

With memory allocation speed throttle(mst) mechanism we could lower the memory allocation speed in certian cgroup, usually for low priority tasks, so that could avoid the direct memory reclaim in time.

And per-memcg interfaces are introduced under memcg tree, not visiable for root memcg.
- <cgroup_root>/<cgroup_name>/memory.alloc_bps
- 0 -> means memory speed throttle disabled
- non-zero -> value in bytes for memory allocation speed limits

- <cgroup_root>/<cgroup_name>/memory.stat:mst_mem_spd_max
it records the max memory allocation speed of the memory cgroup in the last period of time slice

- <cgroup_root>/<cgroup_name>/memory.stat:mst_nr_throttled it represents the number of times for allocation throttling

Yulei Zhang (7):
mm: record total charge and max speed counter in memcg
mm: introduce alloc_bps to memcg for memory allocation speed throttle
mm: memory allocation speed throttle setup in hierarchy
mm: introduce slice analysis into memory speed throttle mechanism
mm: introduce memory allocation speed throttle
mm: record the numbers of memory allocation throttle
mm: introduce mst low and min watermark

 include/linux/memcontrol.h   |  23 +++
 include/linux/page_counter.h |   8 +
 init/Kconfig                 |   8 +
 mm/memcontrol.c              | 295 +++++++++++++++++++++++++++++++++++
 mm/page_counter.c            |  39 +++++
 5 files changed, 373 insertions(+)
Signature · 1 line
2.28.0