STRUCT DAMON_ATTRS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct damon_attrs(9) 🌸

okay so this is the Kernel API Manual page for struct damon_attrs β€” literally the monitoring attributes for accuracy/overhead control. bestie, this is the struct that decides how often DAMON peeks at your memory and how hard it works πŸ’…


✨ SYNOPSIS ✨

struct damon_attrs {
    unsigned long sample_interval;
    unsigned long aggr_interval;
    unsigned long ops_update_interval;
    struct damon_intervals_goal intervals_goal;
    unsigned long min_nr_regions;
    unsigned long max_nr_regions;
 };

it's giving "small struct, big job" energy, ngl 🫢


πŸŽ€ Members πŸŽ€

  • sample_interval β€” the time between access samplings. like, how often we go "hmm, is this region being touched?" πŸ‘€
  • aggr_interval β€” the time between monitor results aggregations. the number-crunching window, basically.
  • ops_update_interval β€” the time between monitoring operations updates. how often the ops get a little refresh ✨
  • intervals_goal β€” the intervals auto-tuning goal. set it and let DAMON tune its own intervals, main character energy fr.
  • min_nr_regions β€” the minimum number of adaptive monitoring regions. the floor, no going below it πŸ’€
  • max_nr_regions β€” the maximum number of adaptive monitoring regions. the ceiling, no going above it πŸ‘‘

🌈 Description 🌈

okay so here's the whole vibe. for each sample_interval, DAMON checks whether each region is accessed or not during the last sample_interval. if such access is found, DAMON aggregates the information by increasing damon_region->nr_accesses for aggr_interval time. for each aggr_interval, the count is reset. πŸ”₯

DAMON also checks whether the target memory regions need update (e.g., by mmap calls from the application, in case of virtual memory monitoring) and applies the changes for each ops_update_interval. πŸ¦‹

πŸ’– heads up: all time intervals are in micro-seconds. yes, micro. not milli. do not come for me.

please refer to struct damon_operations and struct damon_call_control for more detail β€” they have the rest of the lore, iykyk πŸ“–βœ¨


⭐ SEE ALSO ⭐

kernel file ./include/linux/damon.h, plus the whole extended universe bestie:

struct damon_addr_range(9), struct damon_size_range(9), struct damon_region(9), struct damon_target(9), enum damos_action(9), enum damos_quota_goal_metric(9), struct damos_quota_goal(9), enum damos_quota_goal_tuner(9), struct damos_quota(9), enum damos_wmark_metric(9), struct damos_watermarks(9), struct damos_stat(9), enum damos_filter_type(9), struct damos_filter(9), struct damos_walk_control(9), struct damos_access_pattern(9), struct damos_migrate_dests(9), struct damos(9), enum damon_ops_id(9), struct damon_operations(9), struct damon_intervals_goal(9), enum damon_filter_type(9), struct damon_filter(9), struct damon_probe(9), struct damon_ctx(9)

that's a whole friend group right there, it's giving reunion tour πŸŒΈπŸ’œ


and that's the page!! sign-off time πŸŽ€ β€” this little beauty lives under ./include/linux, dated October 2026, and it's struct damon_attrs(9) all day. slay, go tune those intervals bestie βœ¨πŸ’…

πŸ“¦ where this page comes from