* Re: [PATCH] mm/damon/paddr: fix pin page problem [not found] <20230221090313.15396-1-andrew.yang@mediatek.com> @ 2023-02-21 10:08 ` David Hildenbrand 2023-02-21 18:35 ` SeongJae Park 1 sibling, 0 replies; 3+ messages in thread From: David Hildenbrand @ 2023-02-21 10:08 UTC (permalink / raw) To: Andrew Yang, SeongJae Park, Andrew Morton, Matthias Brugger, AngeloGioacchino Del Regno Cc: wsd_upstream, casper.lin, damon, linux-mm, linux-kernel, linux-arm-kernel, linux-mediatek On 21.02.23 10:03, Andrew Yang wrote: > From: "andrew.yang" <andrew.yang@mediatek.com> Nit: I'd suggest a different subject "mm/damon/paddr: fix missing put_page()" Fixes: ? Cc: stable ? I think a patch from Willy is queued that converts this code into folios. > > 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(); -- Thanks, David / dhildenb ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/damon/paddr: fix pin page problem [not found] <20230221090313.15396-1-andrew.yang@mediatek.com> 2023-02-21 10:08 ` [PATCH] mm/damon/paddr: fix pin page problem David Hildenbrand @ 2023-02-21 18:35 ` SeongJae Park 2023-02-22 6:26 ` Andrew Yang (楊智強) 1 sibling, 1 reply; 3+ messages in thread From: SeongJae Park @ 2023-02-21 18:35 UTC (permalink / raw) To: Andrew Yang Cc: SeongJae Park, Andrew Morton, Matthias Brugger, AngeloGioacchino Del Regno, wsd_upstream, casper.lin, damon, linux-mm, linux-kernel, linux-arm-kernel, linux-mediatek, stable Hi Andrew, On Tue, 21 Feb 2023 17:03:13 +0800 Andrew Yang <andrew.yang@mediatek.com> wrote: > 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. Thank you for finding this issue! I think the David suggested subject[1] is better, though. I think we could add below Fixes: and Cc: tags? Fixes: 57223ac29584 ("mm/damon/paddr: support the pageout scheme") Cc: <stable@vger.kernel.org> # 5.16.x > > 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); Seems your patch is not based on mm-unstable tree[2]. Could you please rebase on it? Also, let's remove the braces for the single statements[3]. [1] https://lore.kernel.org/damon/1b3e8e88-ed5c-7302-553f-4ddb3400d466@redhat.com/ [2] https://docs.kernel.org/next/mm/damon/maintainer-profile.html#scm-trees [3] https://docs.kernel.org/process/coding-style.html?highlight=coding+style#placing-braces-and-spaces Thanks, SJ > } > applied = reclaim_pages(&page_list); > cond_resched(); > -- > 2.18.0 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/damon/paddr: fix pin page problem 2023-02-21 18:35 ` SeongJae Park @ 2023-02-22 6:26 ` Andrew Yang (楊智強) 0 siblings, 0 replies; 3+ messages in thread From: Andrew Yang (楊智強) @ 2023-02-22 6:26 UTC (permalink / raw) To: sj@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mm@kvack.org, wsd_upstream, damon@lists.linux.dev, stable@vger.kernel.org, Casper Li (李中榮), akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com On Tue, 2023-02-21 at 18:35 +0000, SeongJae Park wrote: > Hi Andrew, > > > On Tue, 21 Feb 2023 17:03:13 +0800 Andrew Yang < > andrew.yang@mediatek.com> wrote: > > > 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. > > Thank you for finding this issue! I think the David suggested > subject[1] is > better, though. > > I think we could add below Fixes: and Cc: tags? > > Fixes: 57223ac29584 ("mm/damon/paddr: support the pageout scheme") > Cc: <stable@vger.kernel.org> # 5.16.x > > > > > 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); > > Seems your patch is not based on mm-unstable tree[2]. Could you > please rebase > on it? > > Also, let's remove the braces for the single statements[3]. > > [1] > https://lore.kernel.org/damon/1b3e8e88-ed5c-7302-553f-4ddb3400d466@redhat.com/ > [2] > https://urldefense.com/v3/__https://docs.kernel.org/next/mm/damon/maintainer-profile.html*scm-trees__;Iw!!CTRNKA9wMg0ARbw!jlYra3CQPXNsppOWspkAkRO2AfKJEoMyAu8_JvZ9eY5b0YQbTB6sX1Gas-ZRtrMKXfxxpi7PEe8yeg$ > > [3] > https://urldefense.com/v3/__https://docs.kernel.org/process/coding-style.html?highlight=coding*style*placing-braces-and-spaces__;KyM!!CTRNKA9wMg0ARbw!jlYra3CQPXNsppOWspkAkRO2AfKJEoMyAu8_JvZ9eY5b0YQbTB6sX1Gas-ZRtrMKXfxxpi69jIOtSQ$ > > > > Thanks, > SJ > > > } > > applied = reclaim_pages(&page_list); > > cond_resched(); > > -- > > 2.18.0 Thanks for both of your suggestions, I will update the patch. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-22 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230221090313.15396-1-andrew.yang@mediatek.com>
2023-02-21 10:08 ` [PATCH] mm/damon/paddr: fix pin page problem David Hildenbrand
2023-02-21 18:35 ` SeongJae Park
2023-02-22 6:26 ` Andrew Yang (楊智強)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox