aboutsummaryrefslogtreecommitdiffstats
path: root/mm/damon/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/damon/core.c')
-rw-r--r--mm/damon/core.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c
index b6cd99b64e851..7b06d926c552e 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1130,10 +1130,6 @@ static unsigned long damos_quota_score(struct damos_quota *quota)
struct damos_quota_goal *goal;
unsigned long highest_score = 0;
- if (quota->goal.get_score)
- highest_score = quota->goal.get_score(
- quota->goal.get_score_arg);
-
damos_for_each_quota_goal(goal, quota)
highest_score = max(highest_score,
goal->get_score(goal->get_score_arg));
@@ -1142,21 +1138,19 @@ static unsigned long damos_quota_score(struct damos_quota *quota)
}
/*
- * Called only if quota->ms, quota->sz, or quota->goal.get_score are set, or
- * quota->goals is not empty
+ * Called only if quota->ms, or quota->sz are set, or quota->goals is not empty
*/
static void damos_set_effective_quota(struct damos_quota *quota)
{
unsigned long throughput;
unsigned long esz;
- if (!quota->ms && !quota->goal.get_score &&
- list_empty(&quota->goals)) {
+ if (!quota->ms && list_empty(&quota->goals)) {
quota->esz = quota->sz;
return;
}
- if (quota->goal.get_score || !list_empty(&quota->goals)) {
+ if (!list_empty(&quota->goals)) {
unsigned long score = damos_quota_score(quota);
quota->esz_bp = damon_feed_loop_next_input(
@@ -1171,7 +1165,7 @@ static void damos_set_effective_quota(struct damos_quota *quota)
quota->total_charged_ns;
else
throughput = PAGE_SIZE * 1024;
- if (quota->goal.get_score || !list_empty(&quota->goals))
+ if (!list_empty(&quota->goals))
esz = min(throughput * quota->ms, esz);
else
esz = throughput * quota->ms;
@@ -1191,8 +1185,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
unsigned long cumulated_sz;
unsigned int score, max_score = 0;
- if (!quota->ms && !quota->sz && !quota->goal.get_score &&
- list_empty(&quota->goals))
+ if (!quota->ms && !quota->sz && list_empty(&quota->goals))
return;
/* New charge window starts */