mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
mm/damon/paddr: minor refactor of damon_pa_pageout()
Patch series "mm/damon/paddr: minor code improvement", v3. Unify folio_put() to make code more clear, and also fix minor issue in damon_pa_young(). This patch (of 3): Omit three lines by unified folio_put(), and make code more clear. Link: https://lkml.kernel.org/r/20230308083311.120951-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20230308083311.120951-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
22b8cc3e78
commit
dd41143312
@ -238,21 +238,18 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s)
|
||||
if (!folio)
|
||||
continue;
|
||||
|
||||
if (damos_pa_filter_out(s, folio)) {
|
||||
folio_put(folio);
|
||||
continue;
|
||||
}
|
||||
if (damos_pa_filter_out(s, folio))
|
||||
goto put_folio;
|
||||
|
||||
folio_clear_referenced(folio);
|
||||
folio_test_clear_young(folio);
|
||||
if (!folio_isolate_lru(folio)) {
|
||||
folio_put(folio);
|
||||
continue;
|
||||
}
|
||||
if (!folio_isolate_lru(folio))
|
||||
goto put_folio;
|
||||
if (folio_test_unevictable(folio))
|
||||
folio_putback_lru(folio);
|
||||
else
|
||||
list_add(&folio->lru, &folio_list);
|
||||
put_folio:
|
||||
folio_put(folio);
|
||||
}
|
||||
applied = reclaim_pages(&folio_list);
|
||||
|
Loading…
Reference in New Issue
Block a user