Commit 2dc30548 authored by andrew.yang's avatar andrew.yang Committed by Zhong Jinghua
Browse files

mm/damon/paddr: fix missing folio_put()

mainline inclusion
from mainline-v6.3-rc1
commit 3f98c9a6
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6MRUG

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3f98c9a62c338bbe06a215c9491e6166ea39bf82

--------------------------------

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: 57223ac2 ("mm/damon/paddr: support the pageout scheme")
Signed-off-by: default avatarandrew.yang <andrew.yang@mediatek.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>	[5.16.x]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>

Conflicts:
	mm/damon/paddr.c

Signed-off-by: default avatarZe Zuo <zuoze1@huawei.com>
parent 3e665b7e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment