mm-damon-core-add-multiple-goals-per-damos_quota-and-helpers-for-those.patch removed from -mm tree
The quilt patch titled
Subject: mm/damon/core: add multiple goals per damos_quota and helpers for those
has been removed from the -mm tree. Its filename was
mm-damon-core-add-multiple-goals-per-damos_quota-and-helpers-for-those.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: add multiple goals per damos_quota and helpers for those
Date: Mon, 19 Feb 2024 11:44:19 -0800
The feedback-driven DAMOS quota auto-tuning feature allows only single goal to the DAMON kernel API users. The API users could implement multiple goals for the end-users on their level, and that's what DAMON sysfs interface is doing. More DAMON kernel API users such as DAMON_RECLAIM would need to do similar work. To reduce unnecessary future duplciated efforts, support multiple goals from DAMOS core layer. To make the support in minimum non-destructive change, keep the old single goal setup interface, and add multiple goals setup. The single goal will treated as one of the multiple goals, so old API users are not required to make any change.
---
include/linux/damon.h | 17 ++++++++ mm/damon/core.c | 78 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 7 deletions(-)
include/linux/damon.h renamed from include/linux/damon.h~mm-damon-core-add-multiple-goals-per-damos_quota-and-helpers-for-those +17 -0
@@ -130,6 +130,7 @@ enum damos_action {* struct damos_quota_goal - DAMOS scheme quota auto-tuning goal. * @get_score: Function for getting current score of the goal. * @get_score_arg: Parameter for @get_score +* @list: List head for siblings. * * Data structure for getting the current score of the quota tuning goal. * Calling @get_score with @get_score_arg as the parameter should return the
@@ -140,6 +141,7 @@ enum damos_action {struct damos_quota_goal {unsigned long (*get_score)(void *arg);void *get_score_arg; +struct list_head list; };/**
@@ -148,6 +150,7 @@ struct damos_quota_goal {* @ms: Maximum milliseconds that the scheme can use. * @sz: Maximum bytes of memory that the action can be applied. * @goal: Quota auto-tuning goal. +* @goals: Head of quota tuning goals (&damos_quota_goal) list. * @esz: Effective size quota in bytes. * * @weight_sz: Weight of the region's size for prioritization.
@@ -171,6 +174,8 @@ struct damos_quota_goal {* every @reset_interval. Then, if the new size quota is smaller than the * effective quota, it uses the new size quota as the effective quota. * +* If @goals is not empty, same action is taken for each goal of the list. +* * The resulting effective size quota in bytes is set to @esz. * * For selecting regions within the quota, DAMON prioritizes current scheme's
@@ -184,6 +189,7 @@ struct damos_quota {unsigned long ms;unsigned long sz;struct damos_quota_goal goal; +struct list_head goals;unsigned long esz;unsigned int weight_sz;
@@ -648,6 +654,12 @@ static inline unsigned long damon_sz_reg#define damon_for_each_scheme_safe (s, next, ctx) \ list_for_each_entry_safe(s, next, &(ctx)->schemes, list) +#define damos_for_each_quota_goal (goal, quota) \ + list_for_each_entry(goal, "a->goals, list) + +#define damos_for_each_quota_goal_safe (goal, next, quota) \ + list_for_each_entry_safe(goal, next, &(quota)->goals, list) +#define damos_for_each_filter (f, scheme) \ list_for_each_entry(f, &(scheme)->filters, list)
@@ -681,6 +693,11 @@ struct damos_filter *damos_new_filter(envoid damos_add_filter (struct damos *s,struct damos_filter *f);void damos_destroy_filter (struct damos_filter *f); +struct damos_quota_goal *damos_new_quota_goal ( +unsigned long (*get_score)(void *),void *get_score_arg); +void damos_add_quota_goal (struct damos_quota *q,struct damos_quota_goal *g); +void damos_destroy_quota_goal (struct damos_quota_goal *goal); + struct damos *damon_new_scheme(struct damos_access_pattern *pattern, enum damos_action action, unsigned long apply_interval_us,
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-add-multiple-goals-per-damos_quota-and-helpers-for-those +71 -7
127 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are