linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] check MGLRU promoted without hold page lock
@ 2023-10-20  8:43 Huan Yang
  2023-10-20  8:43 ` [PATCH 1/2] tracing: mm: multigen-lru: fix mglru trace Huan Yang
  2023-10-20  8:43 ` [PATCH 2/2] mm: multi-gen LRU: move promoted folio out of lock Huan Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Huan Yang @ 2023-10-20  8:43 UTC (permalink / raw)
  To: Yu Zhao, Steven Rostedt, Masami Hiramatsu, Andrew Morton,
	Huan Yang, Suren Baghdasaryan, Vlastimil Babka, linux-kernel,
	linux-trace-kernel, linux-mm
  Cc: opensource.kernel

This patchset add a new reclaim_stat named nr_promote to observe
number folios which MGLRU promoted before shrink touch, and then
show in mm_vmscan_lru_shrink_inactive. Also, fix nr_scanned in MGLRU
trace into nr_taken. (patch1)

Base this trace, here are many folio promoted before shrink touch,
so, due to the high frequence, move this check before hold page lock
is better.(patch2)

Due to we will not actually touch this folio, nr_promote trace is
unnecessary, remove this trace.

This patchset based on link:
https://lore.kernel.org/all/20231018082104.3918770-1-link@vivo.com/

Which have many mistake pointed by Yu Zhao.(thanks)

Huan Yang (2):
  tracing: mm: multigen-lru: fix mglru trace
  mm: multi-gen LRU: move promoted folio out of lock

 include/trace/events/vmscan.h |  3 ++-
 mm/vmscan.c                   | 31 ++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 10 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 0/2] some fix of multi-gen lru
@ 2023-10-18  8:20 Huan Yang
  2023-10-18  8:20 ` [PATCH 1/2] tracing: mm: multigen-lru: fix mglru trace Huan Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Huan Yang @ 2023-10-18  8:20 UTC (permalink / raw)
  To: Yu Zhao, Steven Rostedt, Masami Hiramatsu, Andrew Morton,
	Huan Yang, Suren Baghdasaryan, Vlastimil Babka, linux-kernel,
	linux-trace-kernel, linux-mm, bpf
  Cc: opensource.kernel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-20  8:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20  8:43 [PATCH 0/2] check MGLRU promoted without hold page lock Huan Yang
2023-10-20  8:43 ` [PATCH 1/2] tracing: mm: multigen-lru: fix mglru trace Huan Yang
2023-10-20  8:43 ` [PATCH 2/2] mm: multi-gen LRU: move promoted folio out of lock Huan Yang
  -- strict thread matches above, loose matches on Subject: below --
2023-10-18  8:20 [PATCH 0/2] some fix of multi-gen lru Huan Yang
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox