Commit dd411433 authored by Kefeng Wang's avatar Kefeng Wang Committed by Andrew Morton

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.comSigned-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 22b8cc3e
...@@ -238,21 +238,18 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s) ...@@ -238,21 +238,18 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s)
if (!folio) if (!folio)
continue; continue;
if (damos_pa_filter_out(s, folio)) { if (damos_pa_filter_out(s, folio))
folio_put(folio); goto put_folio;
continue;
}
folio_clear_referenced(folio); folio_clear_referenced(folio);
folio_test_clear_young(folio); folio_test_clear_young(folio);
if (!folio_isolate_lru(folio)) { if (!folio_isolate_lru(folio))
folio_put(folio); goto put_folio;
continue;
}
if (folio_test_unevictable(folio)) if (folio_test_unevictable(folio))
folio_putback_lru(folio); folio_putback_lru(folio);
else else
list_add(&folio->lru, &folio_list); list_add(&folio->lru, &folio_list);
put_folio:
folio_put(folio); folio_put(folio);
} }
applied = reclaim_pages(&folio_list); applied = reclaim_pages(&folio_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment