From: Huan Yang <link@vivo.com>
To: Yu Zhao <yuzhao@google.com>, Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Huan Yang <link@vivo.com>, Suren Baghdasaryan <surenb@google.com>,
Vlastimil Babka <vbabka@suse.cz>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
linux-mm@kvack.org, bpf@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: [PATCH 0/2] some fix of multi-gen lru
Date: Wed, 18 Oct 2023 16:20:58 +0800 [thread overview]
Message-ID: <20231018082104.3918770-1-link@vivo.com> (raw)
For multi-gen lru shrink_inactive trace, here are
some mistake:
First, nr_scanned in evict_folios means all folios
which it touched in `get_nr_to_scan`(so not means nr_taken).
So, we may get some info from trace like this:
```
kswapd0-89 [000] 64.887613: mm_vmscan_lru_shrink_inactive:
nid=0 nr_scanned=64 nr_reclaimed=0 nr_dirty=0 nr_writeback=0
nr_congested=0 nr_immediate=0 nr_activate_anon=0 nr_activate_file=0
nr_ref_keep=0 nr_unmap_fail=0 priority=4
flags=RECLAIM_WB_FILE|RECLAIM_WB_ASYNC
```
Actually, we don't taken too much folios in shrink. This patch
use difference between before sc->nr_scanned and after shrink to
replace nr_taken and pass this to shrink_inactive tracing.
Second, also like above info, we can't get nr_folios going to where,
actually in multi-gen lru shrink, many keep by folio_update_gen when
look around or other promote this folio.
Third, evict_folios don't gather reclaim_stat info after shrink list,
so, dirty\writeback\congested stat will miss, and we can't control
LRUVEC_CONGESTED or reclaim_throttle.
Patch 1 aim to resolve first and second, patch 2 resolve third.
Huan Yang (2):
tracing: mm: multigen-lru: fix mglru trace
mm: multi-gen lru: fix stat count
include/linux/vmstat.h | 2 ++
include/trace/events/vmscan.h | 8 ++++-
mm/vmscan.c | 61 ++++++++++++++++++++++++++++++++---
3 files changed, 65 insertions(+), 6 deletions(-)
--
2.34.1
next reply other threads:[~2023-10-18 8:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 8:20 Huan Yang [this message]
2023-10-18 8:20 ` [PATCH 1/2] tracing: mm: multigen-lru: fix mglru trace Huan Yang
2023-10-18 16:28 ` Yu Zhao
2023-10-19 2:24 ` Huan Yang
2023-10-18 8:21 ` [PATCH 2/2] mm: multi-gen lru: fix stat count Huan Yang
2023-10-18 16:21 ` Yu Zhao
2023-10-19 2:17 ` Huan Yang
2023-10-19 2:39 ` Yu Zhao
2023-10-19 6:29 ` Huan Yang
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=20231018082104.3918770-1-link@vivo.com \
--to=link@vivo.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=rostedt@goodmis.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=yuzhao@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
all inboxes | Powered by JetHome®