STRUCT DAMON_CTX(9)
struct damon_ctx(9) π
Okay bestie, welcome to the Kernel API Manual page for struct damon_ctx β literally the main-character struct for DAMON monitoring contexts. No cap, iykyk. β¨
π NAME π
struct damon_ctx β represents a context for each monitoring. This is the main interface that allows users to set the attributes and get the results of the monitoring. Periodt. π
π¦ SYNOPSIS π¦
struct damon_ctx {
struct damon_attrs attrs;
unsigned long addr_unit;
unsigned long min_region_sz;
bool pause;
};
β¨ Members β¨
attrsβ monitoring attributes for accuracy/overhead control. Itβs giving βtune the vibe of your monitoringβ energy. ποΈaddr_unitβ scale factor for core to ops address conversion. Yes, it converts addresses, slay. πmin_region_szβ minimum region size. Tiny regions? Not on this structβs watch. πpauseβ pause thekdamondmain loop. Hit pause on the whole monitoring moment. βΈοΈ
π Description π
For each monitoring context, one kernel thread for the monitoring is created β its name is kdamond, and yes, she is the moment. π The pid of kdamond can be retrieved using damon_kdamond_pid.
Once started, kdamond runs until itβs explicitly required to be terminated, or until every monitoring target is invalid. The validity of the targets is checked via the damon_operations.target_valid of ops. The termination can also be explicitly requested by calling damon_stop. To know if a kdamond is running, damon_is_running can be used. Iconic API behavior, honestly. π
β οΈ Bestie, while thekdamondis running, all accesses tostruct damon_ctxfrom a thread other than thekdamondshould be made using safe DAMON APIs β includingdamon_callanddamos_walk. Do not raw-dog that access. Ngl, fr fr, use the safe path. π
π SEE ALSO π
Kernel file ./include/linux/damon.h β and the whole linked-up squad:
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_attrs(9)
xoxo π β source/version: ./include/linux, date: October 2026. Kernel API Manual out. π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms