mm-damon-core-introduce-damon_call.patch removed from -mm tree
The quilt patch titled
Subject: mm/damon/core: introduce damon_call()
has been removed from the -mm tree. Its filename was
mm-damon-core-introduce-damon_call.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: introduce damon_call()
Date: Fri, 3 Jan 2025 09:43:53 -0800
Introduce a new DAMON core API function, damon_call(). It aims to replace some damon_callback usages that access damon_ctx of ongoing kdamond with additional synchronizations. It receives a function pointer, let the parallel kdamond invokes the function, and returns after the invocation is finished, or canceled due to some races.
kdamond invokes the function inside the main loop after sampling is done. If it is deactivated by DAMOS watermarks or already out of the main loop, mark the request as canceled so that damon_call() can wakeup and return.
---
include/linux/damon.h | 26 ++++++++++++ mm/damon/core.c | 86 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)
include/linux/damon.h renamed from include/linux/damon.h~mm-damon-core-introduce-damon_call +26 -0
@@ -552,6 +552,27 @@ struct damon_callback {void (*before_terminate)(struct damon_ctx *context); }; +/* +* struct damon_call_control - Control damon_call(). +* +* @fn: Function to be called back. +* @data: Data that will be passed to @fn. +* @return_code: Return code from @fn invocation. +* +* Control damon_call(), which requests specific kdamond to invoke a given +* function. Refer to damon_call() for more details. +*/ +struct damon_call_control { +int (*fn)(void *data); +void *data; +int return_code; +/* private: internal use only */ +/* informs if the kdamond finished handling of the request */ +struct completion completion; +/* informs if the kdamond canceled @fn infocation */ +bool canceled; +}; +/** * struct damon_attrs - Monitoring attributes for accuracy/overhead control. *
@@ -632,6 +653,9 @@ struct damon_ctx {/* for scheme quotas prioritization */ unsigned long *regions_score_histogram; +struct damon_call_control *call_control; +struct mutex call_control_lock; +/* public: */ struct task_struct *kdamond;struct mutex kdamond_lock;
@@ -779,6 +803,8 @@ static inline unsigned int damon_max_nr_int damon_start (struct damon_ctx **ctxs,int nr_ctxs,bool exclusive);int damon_stop (struct damon_ctx **ctxs,int nr_ctxs); +int damon_call (struct damon_ctx *ctx,struct damon_call_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-introduce-damon_call +86 -0
122 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