All of lore.kernel.org
 help / color / mirror / Atom feed
From: yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	christian-STijNZzMWpgWenYVfaLwtA@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	benbjiang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org,
	kernellwp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Yulei Zhang <yuleixzhang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
Subject: [RFC 0/7] Introduce memory allocation speed throttle in memcg
Date: Thu, 27 May 2021 00:17:57 +0800	[thread overview]
Message-ID: <cover.1622043596.git.yuleixzhang@tencent.com> (raw)

From: Yulei Zhang <yuleixzhang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>

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(+)

-- 
2.28.0


             reply	other threads:[~2021-05-26 16:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 16:17 yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w [this message]
     [not found] ` <cover.1622043596.git.yuleixzhang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2021-05-26 16:17   ` [RFC 1/7] mm: record total charge and max speed counter in memcg yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 16:17   ` [RFC 2/7] mm: introduce alloc_bps to memcg for memory allocation speed throttle yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 16:18   ` [RFC 3/7] mm: memory allocation speed throttle setup in hierarchy yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 16:18   ` [RFC 4/7] mm: introduce slice analysis into memory speed throttle mechanism yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 16:18   ` [RFC 5/7] mm: introduce memory allocation speed throttle yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 16:18   ` [RFC 6/7] mm: record the numbers of memory allocation throttle yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 19:57     ` kernel test robot
2021-05-26 21:34     ` kernel test robot
2021-05-26 16:18   ` [RFC 7/7] mm: introduce mst low and min watermark yulei.kernel-Re5JQEeQqe8AvxtiuMwx3w
2021-05-26 20:52   ` [RFC 0/7] Introduce memory allocation speed throttle in memcg Shakeel Butt
2021-05-26 20:52     ` Shakeel Butt
     [not found]     ` <CALvZod4SoCS6ym8ELTxWd6UwzUp8m_UUdw7oApAhW2WRq0BXqw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-05-31 12:11       ` yulei zhang
2021-05-31 12:11         ` yulei zhang
     [not found]         ` <CACZOiM3VhYyzCTx4FbW=FF8WB=X46xaV53abqOVL+eHQOs8Reg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-05-31 18:20           ` Shakeel Butt
2021-05-31 18:20             ` Shakeel Butt
2021-06-01 14:45           ` Chris Down
2021-06-01 14:45             ` Chris Down
     [not found]             ` <YLZIBpJFkKNBCg2X-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2021-06-02  9:11               ` yulei zhang
2021-06-02  9:11                 ` yulei zhang
     [not found]                 ` <CACZOiM21STLrZgcnEwm8w2t82Qj3Ohy-BGbD5u62gTn=z4X3Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-02 15:39                   ` Shakeel Butt
2021-06-02 15:39                     ` Shakeel Butt
     [not found]                     ` <CALvZod7w1tzxvYCP54KHEo=k=qUd02UTkr+1+b5rTdn-tJt45w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-03 10:19                       ` yulei zhang
2021-06-03 10:19                         ` yulei zhang
     [not found]                         ` <CACZOiM3g6GhJgXurMPeE3A7zO8eUhoUPyUvyT3p2Kw98WkX8+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-03 11:38                           ` Chris Down
2021-06-03 11:38                             ` Chris Down
     [not found]                             ` <YLi/UeS71mk12VZ3-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
2021-06-04 10:15                               ` yulei zhang
2021-06-04 10:15                                 ` yulei zhang
     [not found]                                 ` <CACZOiM03toiqcbtEd8LT26T2GtPsDaFj89o8rjEfELTw=KPvfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-04 11:51                                   ` Chris Down
2021-06-04 11:51                                     ` Chris Down

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1622043596.git.yuleixzhang@tencent.com \
    --to=yulei.kernel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=benbjiang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=christian-STijNZzMWpgWenYVfaLwtA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kernellwp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=yuleixzhang-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.