diff options
author | SeongJae Park <sj@kernel.org> | 2022-09-13 17:44:42 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-10-03 14:03:12 -0700 |
commit | 528ef2d996408d4b9cccf4b23a9976ab5e75cf39 (patch) | |
tree | c5fdd3820535e9468e43ceb4e9f83d0b1cae29aa | |
parent | 34f47ea688bb6d1c6d04f8d72546a623bd8d59de (diff) | |
download | linux-528ef2d996408d4b9cccf4b23a9976ab5e75cf39.tar.gz linux-528ef2d996408d4b9cccf4b23a9976ab5e75cf39.tar.bz2 linux-528ef2d996408d4b9cccf4b23a9976ab5e75cf39.zip |
mm/damon/modules-common: implement a stats parameters generator macro
DAMON_RECLAIM and DAMON_LRU_SORT have module parameters for DAMOS
statistics that having same names. This commit implements a macro for
generating such module parameters so that we can reuse later.
Link: https://lkml.kernel.org/r/20220913174449.50645-16-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/damon/modules-common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/damon/modules-common.h b/mm/damon/modules-common.h index 4c2ce84869d5..ed973e0770ae 100644 --- a/mm/damon/modules-common.h +++ b/mm/damon/modules-common.h @@ -23,3 +23,15 @@ module_param_named(wmarks_high, wmarks.high, ulong, 0600); \ module_param_named(wmarks_mid, wmarks.mid, ulong, 0600); \ module_param_named(wmarks_low, wmarks.low, ulong, 0600); + +#define DEFINE_DAMON_MODULES_DAMOS_STATS_PARAMS(stat, try_name, \ + succ_name, qt_exceed_name) \ + module_param_named(nr_##try_name, stat.nr_tried, ulong, 0400); \ + module_param_named(bytes_##try_name, stat.sz_tried, ulong, \ + 0400); \ + module_param_named(nr_##succ_name, stat.nr_applied, ulong, \ + 0400); \ + module_param_named(bytes_##succ_name, stat.sz_applied, ulong, \ + 0400); \ + module_param_named(qt_exceed_name, stat.qt_exceeds, ulong, \ + 0400); |