damon_set_attrs(9)
π damon_set_attrs β like, the NAME section, bestie
okay so damon_set_attrs is literally the function that sets attributes for the monitoring. that's it, that's the vibe. π
(this whole page lives in the Kernel API Manual, section 9 β very demure, very kernel-API of it.)
β¨ SYNOPSIS β¨
int damon_set_attrs (struct damon_ctx *ctx , struct damon_attrs *attrs );
π«Ά ARGUMENTS π«Ά
ctxβ the monitoring context. the main character, honestly.attrsβ the monitoring attributes. the supporting cast that makes it all work.
πΈ DESCRIPTION πΈ
so what does this icon actually do? it updates the monitoring results and the next monitoring/damos operation schedules. two-for-one slay. π
but β and listen, this is the important part β those things are periodically updated by kdamond, so you gotta call this from safe contexts. like, do not just call it from anywhere, that's not the move. π what counts as a safe context?
- during
damon_ctxsetup time, while the kdamond is not yet started β - inside of
kdamond_fnβ
in detail (iykyk): all DAMON API callers directly call this function for the initial setup of damon_ctx, before calling damon_start. some of the API callers also indirectly call this function via damon_call -> damon_commit for online parameter updates. and finally, kdamond_fn itself uses this for applying auto-tuned monitoring intervals. the range, fr fr. π
β° lowkey crucial: every time interval is in micro-seconds. yes, micro. don't @ me.
β RETURN β
0on success β we love a clean win β¨- a negative error code otherwise π
π SEE ALSO π
the whole friend group, no cap:
- Kernel file
./mm/damon/core.cπ damon_is_registered_ops(9)damon_register_ops(9)damon_select_ops(9)damon_nr_accesses_mvsum(9)damon_probe_hits_wsum(9)damos_filter_for_ops(9)damon_set_schemes(9)damos_commit_quota_goals(9)damos_filters_default_reject(9)damon_commit_ctx(9)damon_nr_running_ctxs(9)damon_start(9)damon_stop(9)damon_is_running(9)damon_kdamond_pid(9)damon_call(9)damos_walk(9)damon_set_region_system_rams_default(9)damon_update_region_access_rate(9)damon_initialized(9)
π¦ okay that's the whole page, bestie. go set those attrs (safely!!).
mwah π β this gem dropped in October 2026, source path ./mm/damon, and it's officially a wrap from the Kernel API Manual crew. stay slay, stay in a safe context. πβ¨
π¦ 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