linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: mhocko@suse.com, hannes@cmpxchg.org, shakeelb@google.com,
	akpm@linux-foundation.org
Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [RFC v2 PATCH 0/5] mm: memcontrol: do memory reclaim when offlining
Date: Sat,  5 Jan 2019 08:19:15 +0800	[thread overview]
Message-ID: <1546647560-40026-1-git-send-email-yang.shi@linux.alibaba.com> (raw)


We have some usecases which create and remove memcgs very frequently,
and the tasks in the memcg may just access the files which are unlikely
accessed by anyone else.  So, we prefer force_empty the memcg before
rmdir'ing it to reclaim the page cache so that they don't get
accumulated to incur unnecessary memory pressure.  Since the memory
pressure may incur direct reclaim to harm some latency sensitive
applications.

Force empty would help out such usecase, however force empty reclaims
memory synchronously when writing to memory.force_empty.  It may take
some time to return and the afterwards operations are blocked by it.
Although this can be done in background, some usecases may need create
new memcg with the same name right after the old one is deleted.  So,
the creation might get blocked by the before reclaim/remove operation.

Delaying memory reclaim in cgroup offline for such usecase sounds
reasonable.  Introduced a new interface, called wipe_on_offline for both
default and legacy hierarchy, which does memory reclaim in css offline
kworker.

v1 -> v2:
* Introduced wipe_on_offline interface suggested by Michal
* Bring force_empty into default hierarchy

Patch #1: Fix some obsolete information about force_empty in the document
Patch #2: A minor improvement to skip swap for force_empty
Patch #3: Introduces wipe_on_offline interface
Patch #4: Being force_empty into default hierarchy
Patch #5: Document update

Yang Shi (5):
      doc: memcontrol: fix the obsolete content about force empty
      mm: memcontrol: do not try to do swap when force empty
      mm: memcontrol: introduce wipe_on_offline interface
      mm: memcontrol: bring force_empty into default hierarchy
      doc: memcontrol: add description for wipe_on_offline

 Documentation/admin-guide/cgroup-v2.rst | 23 +++++++++++++++++++++++
 Documentation/cgroup-v1/memory.txt      | 17 ++++++++++++++---
 include/linux/memcontrol.h              |  3 +++
 mm/memcontrol.c                         | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 94 insertions(+), 4 deletions(-)

             reply	other threads:[~2019-01-05  0:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-05  0:19 Yang Shi [this message]
2019-01-05  0:19 ` [v2 PATCH 1/5] doc: memcontrol: fix the obsolete content about force empty Yang Shi
2019-01-05  0:19 ` [v2 PATCH 2/5] mm: memcontrol: do not try to do swap when " Yang Shi
2019-01-05  0:43   ` Shakeel Butt
2019-01-09 17:55     ` Yang Shi
2019-01-05  0:19 ` [v2 PATCH 3/5] mm: memcontrol: introduce wipe_on_offline interface Yang Shi
2019-01-05  0:47   ` Shakeel Butt
2019-01-09 17:59     ` Yang Shi
2019-01-05  0:19 ` [v2 PATCH 4/5] mm: memcontrol: bring force_empty into default hierarchy Yang Shi
2019-01-05  0:19 ` [v2 PATCH 5/5] doc: memcontrol: add description for wipe_on_offline Yang Shi

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=1546647560-40026-1-git-send-email-yang.shi@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=shakeelb@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).