linux-stable/mm/damon
andrew.yang dca31ef86d mm/damon/paddr: fix missing folio_put()
commit 3f98c9a62c 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: 57223ac295 ("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>
2023-03-10 09:29:41 +01:00
..
Kconfig mm/damon/Kconfig: notify debugfs deprecation plan 2022-10-03 14:03:06 -07:00
Makefile mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
core-test.h mm/damon/core-test: test damon_set_regions 2022-10-03 14:03:06 -07:00
core.c mm/damon/core: add a callback for scheme target regions check 2022-11-30 15:58:43 -08:00
dbgfs-test.h mm/damon/dbgfs-test: fix is_target_id() change 2022-03-22 15:57:12 -07:00
dbgfs.c mm/damon/dbgfs: check if rm_contexts input is for a real context 2022-11-08 15:57:25 -08:00
lru_sort.c mm/damon: use kstrtobool() instead of strtobool() 2022-11-30 15:58:45 -08:00
modules-common.c mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
modules-common.h mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
ops-common.c mm/damon: rename damon_pageout_score() to damon_cold_score() 2022-10-03 14:03:31 -07:00
ops-common.h mm/damon: rename damon_pageout_score() to damon_cold_score() 2022-10-03 14:03:31 -07:00
paddr.c mm/damon/paddr: fix missing folio_put() 2023-03-10 09:29:41 +01:00
reclaim.c mm/damon: use kstrtobool() instead of strtobool() 2022-11-30 15:58:45 -08:00
sysfs-common.c mm/damon/sysfs: move unsigned long range directory to common module 2022-11-30 15:01:25 -08:00
sysfs-common.h mm/damon/sysfs-schemes: implement DAMOS-tried regions clear command 2022-11-30 15:58:44 -08:00
sysfs-schemes.c mm/damon/sysfs-schemes: implement DAMOS-tried regions clear command 2022-11-30 15:58:44 -08:00
sysfs.c mm/damon/sysfs-schemes: implement DAMOS-tried regions clear command 2022-11-30 15:58:44 -08:00
vaddr-test.h damon: convert __damon_va_three_regions to use the VMA iterator 2022-09-26 19:46:16 -07:00
vaddr.c mm/damon: use damon_sz_region() in appropriate place 2022-10-12 18:51:49 -07:00