v1
2026-10-26
DAMON 修复三处竞态 · v1
修复 DAMON target_metric TOCTOU,并把 last_nr_regions、rotation 静态变量移入 damon_ctx。
原始补丁链接
子 Patch(3)
1/3
mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store()
[mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store()] damon_sysfs_add_quota_score() reads damos_sysfs_quota_goal->metric twice, once to set damos_quota_goal->metric to the value, an
2/3
mm/damon/core: move static variable last_nr_regions to damon_ctx
[mm/damon/core: move static variable last_nr_regions to damon_ctx] kdamond_split_regions() uses a static variable last_nr_regions, to infer if the region boundaries are too stable. If it looks too st
3/3
mm/damon/core: move static variable rotation to damon_ctx
[mm/damon/core: move static variable rotation to damon_ctx] damon_split_some_reigons() uses a static variable, rotation, to remember how many times it was called. It is again used to determine fair s