All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Hillf Danton <hdanton@sina.com>, linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Chris Down <chris@chrisdown.name>, Tejun Heo <tj@kernel.org>,
	Roman Gushchin <guro@fb.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shakeel Butt <shakeelb@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	Minchan Kim <minchan@kernel.org>, Mel Gorman <mgorman@suse.de>
Subject: Re: [RFC v1] memcg: add memcg lru for page reclaiming
Date: Tue, 22 Oct 2019 21:30:50 +0800	[thread overview]
Message-ID: <20191022133050.15620-1-hdanton@sina.com> (raw)
In-Reply-To: <20191021115654.14740-1-hdanton@sina.com>


On Mon, 21 Oct 2019 14:14:53 +0200 Michal Hocko wrote:
> 
> On Mon 21-10-19 19:56:54, Hillf Danton wrote:
> > 
> > Currently soft limit reclaim is frozen, see
> > Documentation/admin-guide/cgroup-v2.rst for reasons.
> > 
> > Copying the page lru idea, memcg lru is added for selecting victim
> > memcg to reclaim pages from under memory pressure. It now works in
> > parallel to slr not only because the latter needs some time to reap
> > but the coexistence facilitates it a lot to add the lru in a straight
> > forward manner.
> 
> This doesn't explain what is the problem/feature you would like to
> fix/achieve. It also doesn't explain the overall design. 

1, memcg lru makes page reclaiming hierarchy aware

While doing the high work, memcgs are currently reclaimed one after
another up through the hierarchy; in this RFC after ripping pages off
the first victim, the work finishes with the first ancestor of the victim
added to lru.

Recaliming is defered until kswapd becomes active.

2, memcg lru tries much to avoid overreclaim

Only one memcg is picked off lru in FIFO mode under memory pressure,
and MEMCG_CHARGE_BATCH pages are reclaimed one memcg at a time.

In next version, a new function will be added for kswapd to call,

	void memcg_try_to_free_pages(void)

with CONFIG_MEMCG_LRU dropped and mem_cgroup_soft_limit_reclaim()
untouched.

Thanks
Hillf



  parent reply	other threads:[~2019-10-22 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 11:56 [RFC v1] memcg: add memcg lru for page reclaiming Hillf Danton
2019-10-21 12:14 ` Michal Hocko
2019-10-22  2:17 ` kbuild test robot
2019-10-22  3:37 ` kbuild test robot
2019-10-22 13:30 ` Hillf Danton [this message]
2019-10-22 13:58   ` Michal Hocko
2019-10-23  4:44   ` Hillf Danton
2019-10-23  8:08     ` Michal Hocko

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=20191022133050.15620-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chrisdown.name \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=shakeelb@google.com \
    --cc=tj@kernel.org \
    --cc=willy@infradead.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.