- Aug 2024
-
git.doit.wisc.edu git.doit.wisc.edu
-
int vm_swappiness = 60;
then main parameter that controls how aggressive the system will swap anon pages vs file pages.
-
(sc->order > PAGE_ALLOC_COSTLY_ORDER || sc->priority < DEF_PRIORITY - 2))
constants
-
MIN_NR_GENS
magic number?
-
static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, bool can_swap)
figure out how many pages to scan.
-
static void prepare_scan_control(pg_data_t *pgdat, struct scan_control *sc) {
sets up the struct scan_control. Most of the value come from elsewhere but this function seems to bring it all together.
-
-
git.doit.wisc.edu git.doit.wisc.edu
-
Flag indicating whether KSM should run.
-
flag indicating if KSM should merge same-pages across NUMA nodes
-
KSM_ATTR(advisor_target_scan_time);
target scan time -- used by the EWA?
-
KSM_ATTR(advisor_max_pages_to_scan);
max number of pages to scan per iteration
-
KSM_ATTR(advisor_min_pages_to_scan);
min pages to scan per iteration
-
KSM_ATTR(advisor_max_cpu);
max amount of cpu per iteration of the ksmd?
-
KSM_ATTR(advisor_mode);
the mode that ksm runs in -- only two for now.
-
KSM_ATTR(smart_scan);
smart scan -- not sure what this does
-
KSM_ATTR(stable_node_chains_prune_millisecs);
millis before a page is removed from the stable tree??
-
KSM_ATTR(max_page_sharing);
what is the max number of page sharings -- I think this is how many times a single page can be shared (to limit the length of the reverse map?)
-
KSM_ATTR(use_zero_pages);
shouls KSM use special zero page handling
-
KSM_ATTR(merge_across_nodes);
should ksm merge across NUMA nodes
-
KSM_ATTR(run);
flag indicating if ksm should run (0 or 1)
-
KSM_ATTR(pages_to_scan);
number of pages to scan per loop iteration
-
KSM_ATTR(sleep_millisecs);
sleep time between ksmd loop iterations
-
ksm_thread_pages_to_scan
how many pages to scan. This is what many of the other config values are trying to get at.
-
#define DEFAULT_PAGES_TO_SCAN 100
constant for the number of pages to scan
-
Constant default value for pages to scan
-
configuration for targeted scan time
-
max pages to scan during a single pass of the KSM loop
-
min number of pages to scan during a KSM loo[p
-
config for how much cpu to consume.
-
choose the mode to run -- either using EWA or just some fixed values.
-
function to compute a EWA for the number of pages to scan. Uses many of the config parameters from sysfs
-
configuration for how long before a page is pruned from the stable tree
-
configuration for max page sharing -- not quite sure what this is doing
-
Configuration to decide if KSM should use special handilng for pages filled with zeros.
-
Configuration for the number of pages to scan with each run
-
Configuration for how often the thread should run
-