linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Resend PATCH] mm: mark folio as workingset in lru_deactivate_fn
@ 2023-04-20  8:45 zhaoyang.huang
  2023-04-20 12:06 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: zhaoyang.huang @ 2023-04-20  8:45 UTC (permalink / raw)
  To: Andrew Morton, Johannes Weiner, linux-mm, linux-kernel,
	Zhaoyang Huang, ke.wang

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

The folio will be set as workingset by shrink_active_pages during normal reclaiming.
However, it will be escaped from doing so when madvise move it by lru_deactivate_<file>_fn,
which will affect accuracy of thrashing.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
 mm/swap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/swap.c b/mm/swap.c
index 70e2063..4d1c14f 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -603,6 +603,7 @@ static void lru_deactivate_file_fn(struct lruvec *lruvec, struct folio *folio)
 	lruvec_del_folio(lruvec, folio);
 	folio_clear_active(folio);
 	folio_clear_referenced(folio);
+	folio_set_workingset(folio);
 
 	if (folio_test_writeback(folio) || folio_test_dirty(folio)) {
 		/*
@@ -637,6 +638,7 @@ static void lru_deactivate_fn(struct lruvec *lruvec, struct folio *folio)
 		lruvec_del_folio(lruvec, folio);
 		folio_clear_active(folio);
 		folio_clear_referenced(folio);
+		folio_set_workingset(folio);
 		lruvec_add_folio(lruvec, folio);
 
 		__count_vm_events(PGDEACTIVATE, nr_pages);
-- 
1.9.1



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

* Re: [Resend PATCH] mm: mark folio as workingset in lru_deactivate_fn
  2023-04-20  8:45 [Resend PATCH] mm: mark folio as workingset in lru_deactivate_fn zhaoyang.huang
@ 2023-04-20 12:06 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2023-04-20 12:06 UTC (permalink / raw)
  To: zhaoyang.huang
  Cc: Andrew Morton, Johannes Weiner, linux-mm, linux-kernel,
	Zhaoyang Huang, ke.wang

On Thu, Apr 20, 2023 at 04:45:04PM +0800, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> 
> The folio will be set as workingset by shrink_active_pages during normal reclaiming.
> However, it will be escaped from doing so when madvise move it by lru_deactivate_<file>_fn,
> which will affect accuracy of thrashing.

Why are you resending this?  Johannes pointed out that your
understanding of this situation is wrong.  The folio is being
made _inactive_.  It's clearly no longer part of the working set!


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

end of thread, other threads:[~2023-04-20 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-20  8:45 [Resend PATCH] mm: mark folio as workingset in lru_deactivate_fn zhaoyang.huang
2023-04-20 12:06 ` Matthew Wilcox

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