[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lemiitdd.fsf_-_@yhuang6-desk2.ccr.corp.intel.com>
Date: Wed, 04 Jan 2023 16:41:50 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Michal Hocko <mhocko@...e.com>,
Mina Almasry <almasrymina@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Yang Shi <yang.shi@...ux.alibaba.com>,
Yosry Ahmed <yosryahmed@...gle.com>, weixugc@...gle.com,
Tim Chen <tim.c.chen@...ux.intel.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Jonathan Corbet <corbet@....net>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeelb@...gle.com>,
Muchun Song <songmuchun@...edance.com>, fvdl@...gle.com,
bagasdotme@...il.com, cgroups@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Proactive reclaim/demote discussion (was Re: [PATCH] Revert "mm:
add nodes= arg to memory.reclaim")
Michal Hocko <mhocko@...e.com> writes:
[snip]
> This really requires more discussion.
Let's start the discussion with some summary.
Requirements:
- Proactive reclaim. The counting of current per-memcg proactive
reclaim (memory.reclaim) isn't correct. The demoted, but not
reclaimed pages will be counted as reclaimed. So "echo XXM >
memory.reclaim" may exit prematurely before the specified number of
memory is reclaimed.
- Proactive demote. We need an interface to do per-memcg proactive
demote. We may reuse memory.reclaim via extending the concept of
reclaiming to include demoting. Or, we can add a new interface for
that (for example, memory.demote). In addition to demote from fast
tier to slow tier, in theory, we may need to demote from a set of
nodes to another set of nodes for something like general node
balancing.
- Proactive promote. In theory, this is possible, but there's no real
life requirements yet. And it should use a separate interface, so I
don't think we need to discuss that here.
Open questions:
- Use memory.reclaim or memory.demote for proactive demote. In current
memcg context, reclaiming and demoting is quite different, because
reclaiming will uncharge, while demoting will not. But if we will add
per-memory-tier charging finally, the difference disappears. So the
question becomes whether will we add per-memory-tier charging.
- Whether should we demote from faster tier nodes to lower tier nodes
during the proactive reclaiming. Choice A is to keep as much fast
memory as possible. That is, reclaim from the lowest tier nodes
firstly, then the secondary lowest tier nodes, and so on. Choice B is
to demote at the same time of reclaiming. In this way, if we
proactively reclaim XX MB memory, we may free XX MB memory on the
fastest memory nodes.
- When we proactively demote some memory from a fast memory tier, should
we trigger memory competition in the slower memory tiers? That is,
whether to wake up kswapd of the slower memory tiers nodes? If we
want to make per-memcg proactive demoting to be per-memcg strictly, we
should avoid to trigger the global behavior such as triggering memory
competition in the slower memory tiers. Instead, we can add a global
proactive demote interface for that (such as per-memory-tier or
per-node).
Best Regards,
Huang, Ying
Powered by blists - more mailing lists