5 Matching Annotations
  1. Feb 2025
    1. pressure = scale - (reclaimed * scale / scanned); pressure = pressure * 100 / scale;

      Calculates pressure via reclaim efficiency rather than actual memory pressure.

    1. static ssize_t general_profit_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)

      Can be used to evaluate most efficient use of ksm

    1. if (new_order < MAX_PAGECACHE_ORDER) {

      Adjusts new_order so that it's balanced with the readahead window size while increasing it as much as possible.

    2. if (cur < max / 16) return 4 * cur; if (cur <= max / 2) return 2 * cur;

      Set values for scaling readahead window. Might be too minor to need changes though.

    3. unsigned long newsize = roundup_pow_of_two(size); if (newsize <= max / 32) newsize = newsize * 4; else if (newsize <= max / 4) newsize = newsize * 2; else newsize = max; return newsize;

      These are all heuristics to determine intial readahead size. Trades potentially memory overuse for faster access. Could be changed to not use these hardcoded values.