/* * Enable or disable DAMON_RECLAIM. * * You can enable DAMON_RCLAIM by setting the value of this parameter as ``Y``. * Setting it as ``N`` disables DAMON_RECLAIM. Note that DAMON_RECLAIM could * do no real monitoring and reclamation due to the watermarks-based activation * condition. Refer to below descriptions for the watermarks parameter for * this.
*/ staticbool enabled __read_mostly;
/* * Make DAMON_RECLAIM reads the input parameters again, except ``enabled``. * * Input parameters that updated while DAMON_RECLAIM is running are not applied * by default. Once this parameter is set as ``Y``, DAMON_RECLAIM 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_RECLAIM will be disabled.
*/ staticbool commit_inputs __read_mostly;
module_param(commit_inputs, bool, 0600);
/* * Time threshold for cold memory regions identification in microseconds. * * If a memory region is not accessed for this or longer time, DAMON_RECLAIM * identifies the region as cold, and reclaims. 120 seconds by default.
*/ staticunsignedlong min_age __read_mostly = 120000000;
module_param(min_age, ulong, 0600);
staticstruct damos_quota damon_reclaim_quota = { /* use up to 10 ms time, reclaim up to 128 MiB per 1 sec by default */
.ms = 10,
.sz = 128 * 1024 * 1024,
.reset_interval = 1000, /* Within the quota, page out older regions first. */
.weight_sz = 0,
.weight_nr_accesses = 0,
.weight_age = 1
};
DEFINE_DAMON_MODULES_DAMOS_QUOTAS(damon_reclaim_quota);
/* * Desired level of memory pressure-stall time in microseconds. * * While keeping the caps that set by other quotas, DAMON_RECLAIM automatically * increases and decreases the effective level of the quota aiming this level of * memory pressure is incurred. System-wide ``some`` memory PSI in microseconds * per quota reset interval (``quota_reset_interval_ms``) is collected and * compared to this value to see if the aim is satisfied. Value zero means * disabling this auto-tuning feature. * * Disabled by default.
*/ staticunsignedlong quota_mem_pressure_us __read_mostly;
module_param(quota_mem_pressure_us, ulong, 0600);
/* * User-specifiable feedback for auto-tuning of the effective quota. * * While keeping the caps that set by other quotas, DAMON_RECLAIM automatically * increases and decreases the effective level of the quota aiming receiving this * feedback of value ``10,000`` from the user. DAMON_RECLAIM assumes the feedback * value and the quota are positively proportional. Value zero means disabling * this auto-tuning feature. * * Disabled by default. *
*/ staticunsignedlong quota_autotune_feedback __read_mostly;
module_param(quota_autotune_feedback, ulong, 0600);
/* * Start of the target memory region in physical address. * * The start physical address of memory region that DAMON_RECLAIM 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_RECLAIM 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);
/* * Skip anonymous pages reclamation. * * If this parameter is set as ``Y``, DAMON_RECLAIM does not reclaim anonymous * pages. By default, ``N``.
*/ staticbool skip_anon __read_mostly;
module_param(skip_anon, bool, 0600);
/* * PID of the DAMON thread * * If DAMON_RECLAIM is enabled, this becomes the PID of the worker thread. * Else, -1.
*/ staticint kdamond_pid __read_mostly = -1;
module_param(kdamond_pid, int, 0400);
staticstruct damos *damon_reclaim_new_scheme(void)
{ struct damos_access_pattern pattern = { /* Find regions having PAGE_SIZE or larger size */
.min_sz_region = PAGE_SIZE,
.max_sz_region = ULONG_MAX, /* and not accessed at all */
.min_nr_accesses = 0,
.max_nr_accesses = 0, /* for min_age or more micro-seconds */
.min_age_region = min_age /
damon_reclaim_mon_attrs.aggr_interval,
.max_age_region = UINT_MAX,
};
return damon_new_scheme(
&pattern, /* page out those, as soon as found */
DAMOS_PAGEOUT, /* for each aggregation interval */
0, /* under the quota. */
&damon_reclaim_quota, /* (De)activate this according to the watermarks. */
&damon_reclaim_wmarks,
NUMA_NO_NODE);
}
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.