This patch implements support NUMA-aware DAMON modules by adding kernel module parameters. With this patch, DAMON_RECLAIM and DAMON_LRU_SORT can use this feature. Signed-off-by: Jonghyeon Kim <tome01@xxxxxxxxxx> --- mm/damon/lru_sort.c | 1 + mm/damon/modules-common.h | 4 +++- mm/damon/reclaim.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 3de2916a6..3e25a52de 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -81,6 +81,7 @@ static struct damos_watermarks damon_lru_sort_wmarks = { .high = 200, /* 20 percent */ .mid = 150, /* 15 percent */ .low = 50, /* 5 percent */ + .target_nid = NUMA_NO_NODE, }; DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_lru_sort_wmarks); diff --git a/mm/damon/modules-common.h b/mm/damon/modules-common.h index f49cdb417..b167bb24a 100644 --- a/mm/damon/modules-common.h +++ b/mm/damon/modules-common.h @@ -27,11 +27,13 @@ module_param_named(quota_sz, quota.sz, ulong, 0600); #define DEFINE_DAMON_MODULES_WMARKS_PARAMS(wmarks) \ + module_param_named(metric, wmarks.metric, uint, 0600); \ module_param_named(wmarks_interval, wmarks.interval, ulong, \ 0600); \ 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); + module_param_named(wmarks_low, wmarks.low, ulong, 0600); \ + module_param_named(target_nid, wmarks.target_nid, int, 0600); #define DEFINE_DAMON_MODULES_DAMOS_STATS_PARAMS(stat, try_name, \ succ_name, qt_exceed_name) \ diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index 66e190f03..31b8830a8 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -68,6 +68,7 @@ static struct damos_watermarks damon_reclaim_wmarks = { .high = 500, /* 50 percent */ .mid = 400, /* 40 percent */ .low = 200, /* 20 percent */ + .target_nid = NUMA_NO_NODE, }; DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_reclaim_wmarks); -- 2.34.1