]> git.baikalelectronics.ru Git - kernel.git/commit
mm/damon/paddr: fix missing folio_put()
authorandrew.yang <andrew.yang@mediatek.com>
Wed, 22 Feb 2023 06:42:20 +0000 (14:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:20 +0000 (09:34 +0100)
commitda83c174be151cc06e3fcc85354307ea09cb84c1
tree0dd3ab9ad2e38d4355cdcd5123956cef42bd70d2
parent4b8fdb2e8eb2aacd08b45f458365bb5b84fcd27a
mm/damon/paddr: fix missing folio_put()

commit b43a96ee8f9ac23fd1b6ec309a8290a5169b0afb 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: bbaa0feea315 ("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