@@ -41,6 +41,8 @@ struct damon_addr_range {
* @nr_accesses: Access frequency of this region.
* @list: List head for siblings.
* @age: Age of this region.
+ * @local: Local numa node accesses.
+ * @remote: Remote numa node accesses.
*
* @age is initially zero, increased for each aggregation interval, and reset
* to zero again if the access frequency is significantly changed. If two
@@ -56,6 +58,8 @@ struct damon_region {
unsigned int age;
/* private: Internal value for age calculation. */
unsigned int last_nr_accesses;
+ unsigned long local;
+ unsigned long remote;
};
/**
@@ -45,6 +45,8 @@ struct damon_region *damon_new_region(unsigned long start, unsigned long end)
region->age = 0;
region->last_nr_accesses = 0;
+ region->local = 0;
+ region->remote = 0;
return region;
}
@@ -740,6 +742,8 @@ static void damon_merge_two_regions(struct damon_target *t,
l->nr_accesses = (l->nr_accesses * sz_l + r->nr_accesses * sz_r) /
(sz_l + sz_r);
+ l->remote = (l->remote * sz_l + r->remote * sz_r) / (sz_l + sz_r);
+ l->local = (l->local * sz_l + r->local * sz_r) / (sz_l + sz_r);
l->age = (l->age * sz_l + r->age * sz_r) / (sz_l + sz_r);
l->ar.end = r->ar.end;
damon_destroy_region(r, t);
@@ -812,6 +816,8 @@ static void damon_split_region_at(struct damon_ctx *ctx,
new->age = r->age;
new->last_nr_accesses = r->last_nr_accesses;
+ new->local = r->local;
+ new->remote = r->remote;
damon_insert_region(new, r, damon_next_region(r), t);
}