OSDN Git Service

mm/damon/core: update monitoring results for new monitoring attributes
authorSeongJae Park <sj@kernel.org>
Thu, 19 Jan 2023 01:38:30 +0000 (01:38 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:26 +0000 (22:33 -0800)
commit2f5bef5a590be4bf4111ee8f49d97a8613a3e980
tree881b48deb6d624e6d6fe638818c45e922aacbb7e
parent6b3f013bb90e737b06c7955571407190b4c760ce
mm/damon/core: update monitoring results for new monitoring attributes

region->nr_accesses is the number of sampling intervals in the last
aggregation interval that access to the region has found, and region->age
is the number of aggregation intervals that its access pattern has
maintained.  Hence, the real meaning of the two fields' values is
depending on current sampling and aggregation intervals.

This means the values need to be updated for every sampling and/or
aggregation intervals updates.  As DAMON core doesn't, it is a duty of
in-kernel DAMON framework applications like DAMON sysfs interface, or the
userspace users.

Handling it in userspace or in-kernel DAMON application is complicated,
inefficient, and repetitive compared to doing the update in DAMON core.
Do the update in DAMON core.

Link: https://lkml.kernel.org/r/20230119013831.1911-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c