On Tue, 10 Mar 2020 09:00:26 +0000 Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> wrote: > On Mon, 24 Feb 2020 13:30:37 +0100 > SeongJae Park <sjpark@xxxxxxxxxx> wrote: > > > From: SeongJae Park <sjpark@xxxxxxxxx> > > > > Only a number of parts in the virtual address space of the processes is > > mapped to physical memory and accessed. Thus, tracking the unmapped > > address regions is just wasteful. However, tracking every memory > > mapping change might incur an overhead. For the reason, DAMON applies > > the dynamic memory mapping changes to the tracking regions only for each > > of a user-specified time interval (``regions update interval``). > > > > Signed-off-by: SeongJae Park <sjpark@xxxxxxxxx> > Trivial inline. Otherwise makes sense to me. > [...] > > +static void damon_apply_three_regions(struct damon_ctx *ctx, > > + struct damon_task *t, struct region bregions[3]) > > +{ > > + struct damon_region *r, *next; > > + unsigned int i = 0; > > + > > + /* Remove regions which isn't in the three big regions now */ > > + damon_for_each_region_safe(r, next, t) { > > + for (i = 0; i < 3; i++) { > > + if (damon_intersect(r, &bregions[i])) > > + break; > > + } > > + if (i == 3) > > + damon_destroy_region(r); > > + } > > + > > + /* Adjust intersecting regions to fit with the threee big regions */ > > three Good eye! Thanks for finding :) [...]