#define pr_fmt(fmt) …
#include <linux/damon.h>
#include <linux/kstrtox.h>
#include <linux/module.h>
#include "modules-common.h"
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#define MODULE_PARAM_PREFIX …
static bool enabled __read_mostly;
static bool commit_inputs __read_mostly;
module_param(commit_inputs, bool, 0600);
static unsigned long hot_thres_access_freq = …;
module_param(hot_thres_access_freq, ulong, 0600);
static unsigned long cold_min_age __read_mostly = …;
module_param(cold_min_age, ulong, 0600);
static struct damos_quota damon_lru_sort_quota = …;
DEFINE_DAMON_MODULES_DAMOS_TIME_QUOTA(damon_lru_sort_quota);
static struct damos_watermarks damon_lru_sort_wmarks = …;
DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_lru_sort_wmarks);
static struct damon_attrs damon_lru_sort_mon_attrs = …;
DEFINE_DAMON_MODULES_MON_ATTRS_PARAMS(damon_lru_sort_mon_attrs);
static unsigned long monitor_region_start __read_mostly;
module_param(monitor_region_start, ulong, 0600);
static unsigned long monitor_region_end __read_mostly;
module_param(monitor_region_end, ulong, 0600);
static int kdamond_pid __read_mostly = …;
module_param(kdamond_pid, int, 0400);
static struct damos_stat damon_lru_sort_hot_stat;
DEFINE_DAMON_MODULES_DAMOS_STATS_PARAMS(damon_lru_sort_hot_stat,
lru_sort_tried_hot_regions, lru_sorted_hot_regions,
hot_quota_exceeds);
static struct damos_stat damon_lru_sort_cold_stat;
DEFINE_DAMON_MODULES_DAMOS_STATS_PARAMS(damon_lru_sort_cold_stat,
lru_sort_tried_cold_regions, lru_sorted_cold_regions,
cold_quota_exceeds);
static struct damos_access_pattern damon_lru_sort_stub_pattern = …;
static struct damon_ctx *ctx;
static struct damon_target *target;
static struct damos *damon_lru_sort_new_scheme(
struct damos_access_pattern *pattern, enum damos_action action)
{ … }
static struct damos *damon_lru_sort_new_hot_scheme(unsigned int hot_thres)
{ … }
static struct damos *damon_lru_sort_new_cold_scheme(unsigned int cold_thres)
{ … }
static int damon_lru_sort_apply_parameters(void)
{ … }
static int damon_lru_sort_turn(bool on)
{ … }
static int damon_lru_sort_enabled_store(const char *val,
const struct kernel_param *kp)
{ … }
static const struct kernel_param_ops enabled_param_ops = …;
module_param_cb(…);
MODULE_PARM_DESC(…) …;
static int damon_lru_sort_handle_commit_inputs(void)
{ … }
static int damon_lru_sort_after_aggregation(struct damon_ctx *c)
{ … }
static int damon_lru_sort_after_wmarks_check(struct damon_ctx *c)
{ … }
static int __init damon_lru_sort_init(void)
{ … }
module_init(…) …;