mm/damon/paddr: make supported DAMOS actions of paddr clear
authorSeongJae Park <sj@kernel.org>
Tue, 13 Sep 2022 17:44:28 +0000 (17:44 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:09 +0000 (14:03 -0700)
Patch series "mm/damon: cleanup code".

DAMON code was not so clean from the beginning, but it has been too much
nowadays, especially due to the duplicates in DAMON_RECLAIM and
DAMON_LRU_SORT.  This patchset cleans some of the mess.

This patch (of 22):

The 'switch-case' statement in 'damon_va_apply_scheme()' function provides
a 'case' for every supported DAMOS action while all not-yet-supported
DAMOS actions fall through the 'default' case, and comment it so that
people can easily know which actions are supported.  Its counterpart in
'paddr', 'damon_pa_apply_scheme()', however, doesn't.  This commit makes
the 'paddr' side function follows the pattern of 'vaddr' for better
readability and consistency.

Link: https://lkml.kernel.org/r/20220913174449.50645-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20220913174449.50645-2-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/paddr.c

index 6b0d9e6..219127c 100644 (file)
@@ -275,7 +275,10 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
                return damon_pa_mark_accessed(r);
        case DAMOS_LRU_DEPRIO:
                return damon_pa_deactivate_pages(r);
+       case DAMOS_STAT:
+               break;
        default:
+               /* DAMOS actions that not yet supported by 'paddr'. */
                break;
        }
        return 0;