damon.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon/paddr: fix pin page problem
@ 2023-02-21  9:03 Andrew Yang
  2023-02-21 10:08 ` David Hildenbrand
  2023-02-21 18:35 ` SeongJae Park
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Yang @ 2023-02-21  9:03 UTC (permalink / raw)
  To: SeongJae Park, Andrew Morton, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: wsd_upstream, casper.lin, andrew.yang, damon, linux-mm,
	linux-kernel, linux-arm-kernel, linux-mediatek

From: "andrew.yang" <andrew.yang@mediatek.com>

damon_get_page() would always increase page _refcount and
isolate_lru_page() would increase page _refcount if the page's lru
flag is set.

If a unevictable page isolated successfully, there will be two more
_refcount. The one from isolate_lru_page() will be decreased in
putback_lru_page(), but the other one from damon_get_page() will be
left behind. This causes a pin page.

Whatever the case, the _refcount from damon_get_page() should be
decreased.

Signed-off-by: andrew.yang <andrew.yang@mediatek.com>
---
 mm/damon/paddr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index e1a4315c4be6..56d8abd08fb1 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -223,8 +223,8 @@ static unsigned long damon_pa_pageout(struct damon_region *r)
 			putback_lru_page(page);
 		} else {
 			list_add(&page->lru, &page_list);
-			put_page(page);
 		}
+		put_page(page);
 	}
 	applied = reclaim_pages(&page_list);
 	cond_resched();
-- 
2.18.0


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

end of thread, other threads:[~2023-02-21 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21  9:03 [PATCH] mm/damon/paddr: fix pin page problem Andrew Yang
2023-02-21 10:08 ` David Hildenbrand
2023-02-21 18:35 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).