mm-damon-core-implement-damos_walk.patch removed from -mm tree
The quilt patch titled
Subject: mm/damon/core: implement damos_walk()
has been removed from the -mm tree. Its filename was
mm-damon-core-implement-damos_walk.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: SeongJae Park <[email protected]>
Subject: mm/damon/core: implement damos_walk()
Date: Fri, 3 Jan 2025 09:43:57 -0800
Introduce a new core layer interface, damos_walk(). It aims to replace some damon_callback usages that access DAMOS schemes applied regions of ongoing kdamond with additional synchronizations. It receives a function pointer and asks kdamond to invoke it for any region that it tried to apply any DAMOS action within one scheme apply interval for every scheme of it. The function further waits until the kdamond finishes the invocations for every scheme, or cancels the request, and returns.
The kdamond invokes the function as requested within the main loop. If it is deactivated by DAMOS watermarks or going out of the main loop, it marks the request as canceled, so that damos_walk() can wakeup and return.
---
include/linux/damon.h | 33 +++++++++- mm/damon/core.c | 132 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 2 deletions(-)
include/linux/damon.h renamed from include/linux/damon.h~mm-damon-core-implement-damos_walk +31 -2
@@ -352,6 +352,31 @@ struct damos_filter {struct list_head list; }; +struct damon_ctx ; +struct damos ; + +/** +* struct damos_walk_control - Control damos_walk(). +* +* @walk_fn: Function to be called back for each region. +* @data: Data that will be passed to walk functions. +* +* Control damos_walk(), which requests specific kdamond to invoke the given +* function to each region that eligible to apply actions of the kdamond's +* schemes. Refer to damos_walk() for more details. +*/ +struct damos_walk_control { +void (*walk_fn)(void *data,struct damon_ctx *ctx, +struct damon_target *t,struct damon_region *r, +struct damos *s); +void *data; +/* private: internal use only */ +/* informs if the kdamond finished handling of the walk request */ +struct completion completion; +/* informs if the walk is canceled. */ +bool canceled; +}; +/** * struct damos_access_pattern - Target access pattern of the given scheme. * @min_sz_region: Minimum size of target regions.
@@ -415,6 +440,8 @@ struct damos {* @action */ unsigned long next_apply_sis; +/* informs if ongoing DAMOS walk for this scheme is finished */ +bool walk_completed;/* public: */ struct damos_quota quota;struct damos_watermarks wmarks;
@@ -442,8 +469,6 @@ enum damon_ops_id { NR_DAMON_OPS, }; -struct damon_ctx ; -/** * struct damon_operations - Monitoring operations for given use cases. *
@@ -656,6 +681,9 @@ struct damon_ctx {struct damon_call_control *call_control;struct mutex call_control_lock; +struct damos_walk_control *walk_control; +struct mutex walk_control_lock; +/* public: */ struct task_struct *kdamond;struct mutex kdamond_lock;
@@ -804,6 +832,7 @@ int damon_start(struct damon_ctx **ctxs,int damon_stop (struct damon_ctx **ctxs,int nr_ctxs);int damon_call (struct damon_ctx *ctx,struct damon_call_control *control); +int damos_walk (struct damon_ctx *ctx,struct damos_walk_control *control);int damon_set_region_biggest_system_ram_default (struct damon_target *t,unsigned long *start,unsigned long *end);
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-implement-damos_walk +132 -0
180 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
docs-mm-damon-design-add-monitoring-parameters-tuning-guide.patch docs-mm-damon-add-an-example-monitoring-intervals-tuning.patch docs-admin-guide-mm-damon-usage-fix-and-add-missing-damos-filter-sysfs-files-on-files-hierarchy.patch docs-admin-guide-mm-damon-start-update-snapshot-example.patch mm-damon-explain-effective-quota-on-kernel-doc-comment.patch