From: Johannes Weiner <hannes@cmpxchg.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: akpm@linux-foundation.org, mhocko@kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm, memcg: add workingset_restore in memory.stat
Date: Sat, 2 May 2020 10:48:58 -0400 [thread overview]
Message-ID: <20200502144858.GC51551@cmpxchg.org> (raw)
In-Reply-To: <20200502141849.7465-1-laoar.shao@gmail.com>
On Sat, May 02, 2020 at 10:18:49AM -0400, Yafang Shao wrote:
> There's a new workingset counter introduced in commit 1899ad18c607 ("mm:
> workingset: tell cache transitions from workingset thrashing"). With the
> help of this counter we can know the workingset is transitioning or
> thrashing. To leverage the benifit of this counter to memcg, we should
> introduce it into memory.stat. Then we could know the workingset of the
> workload inside a memcg better.
>
> Bellow is the verification of this new counter in memory.stat.
>
> Read a file into the memory and then read it again to make these pages be
> active. The size of this file is 1G. (memory.max is greater than file size)
> The counters in memory.stat will be,
> inactive_file 0
> active_file 1073639424
>
> workingset_refault 0
> workingset_activate 0
> workingset_restore 0
> workingset_nodereclaim 0
> Trigger the memcg reclaim by setting a lower value to memory.high, and
> then some pages will be demoted into inactive list, and then some pages
> in the inactive list will be evicted into the storage.
> inactive_file 498094080
> active_file 310063104
>
> workingset_refault 0
> workingset_activate 0
> workingset_restore 0
> workingset_nodereclaim 0
> Then recover the memory.high and read the file into memory again. As a
> result of it, the transitioning will occur. Bellow is the result of this
> transitioning,
> inactive_file 498094080
> active_file 575397888
>
> workingset_refault 64746
> workingset_activate 64746
> workingset_restore 64746
> workingset_nodereclaim 0
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Thanks, yes, I've missed that counter a few times while debugging
something but never gotten around to actually adding it.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
next prev parent reply other threads:[~2020-05-02 14:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 14:18 Yafang Shao
2020-05-02 14:48 ` Johannes Weiner [this message]
2020-05-04 9:10 ` Michal Hocko
2020-05-04 12:35 ` Yafang Shao
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=20200502144858.GC51551@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox