]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Mar 2023 08:29:55 +0000 (09:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Mar 2023 08:29:55 +0000 (09:29 +0100)
added patches:
mm-damon-paddr-fix-missing-folio_put.patch

queue-6.2/mm-damon-paddr-fix-missing-folio_put.patch [new file with mode: 0644]
queue-6.2/series

diff --git a/queue-6.2/mm-damon-paddr-fix-missing-folio_put.patch b/queue-6.2/mm-damon-paddr-fix-missing-folio_put.patch
new file mode 100644 (file)
index 0000000..d6c8c37
--- /dev/null
@@ -0,0 +1,51 @@
+From 3f98c9a62c338bbe06a215c9491e6166ea39bf82 Mon Sep 17 00:00:00 2001
+From: "andrew.yang" <andrew.yang@mediatek.com>
+Date: Wed, 22 Feb 2023 14:42:20 +0800
+Subject: mm/damon/paddr: fix missing folio_put()
+
+From: andrew.yang <andrew.yang@mediatek.com>
+
+commit 3f98c9a62c338bbe06a215c9491e6166ea39bf82 upstream.
+
+damon_get_folio() would always increase folio _refcount and
+folio_isolate_lru() would increase folio _refcount if the folio's lru flag
+is set.
+
+If an unevictable folio isolated successfully, there will be two more
+_refcount.  The one from folio_isolate_lru() will be decreased in
+folio_puback_lru(), but the other one from damon_get_folio() will be left
+behind.  This causes a pin page.
+
+Whatever the case, the _refcount from damon_get_folio() should be
+decreased.
+
+Link: https://lkml.kernel.org/r/20230222064223.6735-1-andrew.yang@mediatek.com
+Fixes: 57223ac29584 ("mm/damon/paddr: support the pageout scheme")
+Signed-off-by: andrew.yang <andrew.yang@mediatek.com>
+Reviewed-by: SeongJae Park <sj@kernel.org>
+Cc: <stable@vger.kernel.org>   [5.16.x]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: SeongJae Park <sj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/damon/paddr.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/mm/damon/paddr.c
++++ b/mm/damon/paddr.c
+@@ -219,12 +219,11 @@ static unsigned long damon_pa_pageout(st
+                       put_page(page);
+                       continue;
+               }
+-              if (PageUnevictable(page)) {
++              if (PageUnevictable(page))
+                       putback_lru_page(page);
+-              } else {
++              else
+                       list_add(&page->lru, &page_list);
+-                      put_page(page);
+-              }
++              put_page(page);
+       }
+       applied = reclaim_pages(&page_list);
+       cond_resched();
index 629c7f212c51c378594872c8f1c414e37b582049..747e21a8ca503e9184a37696ab229782e78d9ae1 100644 (file)
@@ -886,3 +886,4 @@ irqdomain-refactor-__irq_domain_alloc_irqs.patch
 irqdomain-fix-mapping-creation-race.patch
 irqdomain-fix-domain-registration-race.patch
 crypto-qat-fix-out-of-bounds-read.patch
+mm-damon-paddr-fix-missing-folio_put.patch