]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/damon/core: introduce damon_ops->apply_probes
authorSeongJae Park <sj@kernel.org>
Mon, 18 May 2026 23:40:54 +0000 (16:40 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 2 Jun 2026 22:22:26 +0000 (15:22 -0700)
Extend damon_operations struct with a new callback, namely apply_probes.
The callback will be invoked for data attributes monitoring.  More
specifically, the callback will apply damon_probe objects to each region
and update the per-region per-probe counters for the number of encountered
probe-positive samples.

Link: https://lore.kernel.org/20260518234119.97569-7-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/damon.h

index 3a30af119ac6ec46b25ae83e57e413263d54b985..1fb271a35e98f2096dbc215ef966c913c5fdd607 100644 (file)
@@ -630,6 +630,7 @@ enum damon_ops_id {
  * @update:                    Update operations-related data structures.
  * @prepare_access_checks:     Prepare next access check of target regions.
  * @check_accesses:            Check the accesses to target regions.
+ * @apply_probes:              Apply probes for each region.
  * @get_scheme_score:          Get the score of a region for a scheme.
  * @apply_scheme:              Apply a DAMON-based operation scheme.
  * @target_valid:              Determine if the target is valid.
@@ -656,6 +657,8 @@ enum damon_ops_id {
  * last preparation and update the number of observed accesses of each region.
  * It should also return max number of observed accesses that made as a result
  * of its update.  The value will be used for regions adjustment threshold.
+ * @apply_probes should apply the data attribute probes to each region and
+ * accordingly update the probe hits counter of the region.
  * @get_scheme_score should return the priority score of a region for a scheme
  * as an integer in [0, &DAMOS_MAX_SCORE].
  * @apply_scheme is called from @kdamond when a region for user provided
@@ -673,6 +676,7 @@ struct damon_operations {
        void (*update)(struct damon_ctx *context);
        void (*prepare_access_checks)(struct damon_ctx *context);
        unsigned int (*check_accesses)(struct damon_ctx *context);
+       void (*apply_probes)(struct damon_ctx *context);
        int (*get_scheme_score)(struct damon_ctx *context,
                        struct damon_region *r, struct damos *scheme);
        unsigned long (*apply_scheme)(struct damon_ctx *context,