/* * Enable or disable DAMON_LRU_SORT. * * You can enable DAMON_LRU_SORT by setting the value of this parameter as * ``Y``. Setting it as ``N`` disables DAMON_LRU_SORT. Note that * DAMON_LRU_SORT could do no real monitoring and LRU-lists sorting due to the * watermarks-based activation condition. Refer to below descriptions for the * watermarks parameter for this.
*/ staticbool enabled __read_mostly;
/* * Make DAMON_LRU_SORT reads the input parameters again, except ``enabled``. * * Input parameters that updated while DAMON_LRU_SORT is running are not * applied by default. Once this parameter is set as ``Y``, DAMON_LRU_SORT * reads values of parametrs except ``enabled`` again. Once the re-reading is * done, this parameter is set as ``N``. If invalid parameters are found while * the re-reading, DAMON_LRU_SORT will be disabled.
*/ staticbool commit_inputs __read_mostly;
module_param(commit_inputs, bool, 0600);
/* * Access frequency threshold for hot memory regions identification in permil. * * If a memory region is accessed in frequency of this or higher, * DAMON_LRU_SORT identifies the region as hot, and mark it as accessed on the * LRU list, so that it could not be reclaimed under memory pressure. 50% by * default.
*/ staticunsignedlong hot_thres_access_freq = 500;
module_param(hot_thres_access_freq, ulong, 0600);
/* * Time threshold for cold memory regions identification in microseconds. * * If a memory region is not accessed for this or longer time, DAMON_LRU_SORT * identifies the region as cold, and mark it as unaccessed on the LRU list, so * that it could be reclaimed first under memory pressure. 120 seconds by * default.
*/ staticunsignedlong cold_min_age __read_mostly = 120000000;
module_param(cold_min_age, ulong, 0600);
staticstruct damos_quota damon_lru_sort_quota = { /* Use up to 10 ms per 1 sec, by default */
.ms = 10,
.sz = 0,
.reset_interval = 1000, /* Within the quota, mark hotter regions accessed first. */
.weight_sz = 0,
.weight_nr_accesses = 1,
.weight_age = 0,
};
DEFINE_DAMON_MODULES_DAMOS_TIME_QUOTA(damon_lru_sort_quota);
/* * Start of the target memory region in physical address. * * The start physical address of memory region that DAMON_LRU_SORT will do work * against. By default, biggest System RAM is used as the region.
*/ staticunsignedlong monitor_region_start __read_mostly;
module_param(monitor_region_start, ulong, 0600);
/* * End of the target memory region in physical address. * * The end physical address of memory region that DAMON_LRU_SORT will do work * against. By default, biggest System RAM is used as the region.
*/ staticunsignedlong monitor_region_end __read_mostly;
module_param(monitor_region_end, ulong, 0600);
/* * PID of the DAMON thread * * If DAMON_LRU_SORT is enabled, this becomes the PID of the worker thread. * Else, -1.
*/ staticint kdamond_pid __read_mostly = -1;
module_param(kdamond_pid, int, 0400);
/* Use half of total quota for hot/cold pages sorting */
quota.ms = quota.ms / 2;
return damon_new_scheme( /* find the pattern, and */
pattern, /* (de)prioritize on LRU-lists */
action, /* for each aggregation interval */
0, /* under the quota. */
"a, /* (De)activate this according to the watermarks. */
&damon_lru_sort_wmarks,
NUMA_NO_NODE);
}
/* Create a DAMON-based operation scheme for hot memory regions */ staticstruct damos *damon_lru_sort_new_hot_scheme(unsignedint hot_thres)
{ struct damos_access_pattern pattern = damon_lru_sort_stub_pattern;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.