* @reset_interval: Charge reset interval in milliseconds.
* @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.
*
* throughput of the scheme's action. DAMON then compares it against &sz and
* uses smaller one as the effective quota.
*
- * If ->get_score field of @goal is set, DAMON calculates yet another size
- * quota based on the goal using its internal feedback loop algorithm, for
- * 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.
+ * If @goals is not empt, DAMON calculates yet another size quota based on the
+ * goals using its internal feedback loop algorithm, for 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.
*
* The resulting effective size quota in bytes is set to @esz.
*
unsigned long reset_interval;
unsigned long ms;
unsigned long sz;
- struct damos_quota_goal goal;
struct list_head goals;
unsigned long esz;
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));
}
/*
- * 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("a->goals)) {
+ if (!quota->ms && list_empty("a->goals)) {
quota->esz = quota->sz;
return;
}
- if (quota->goal.get_score || !list_empty("a->goals)) {
+ if (!list_empty("a->goals)) {
unsigned long score = damos_quota_score(quota);
quota->esz_bp = damon_feed_loop_next_input(
quota->total_charged_ns;
else
throughput = PAGE_SIZE * 1024;
- if (quota->goal.get_score || !list_empty("a->goals))
+ if (!list_empty("a->goals))
esz = min(throughput * quota->ms, esz);
else
esz = throughput * quota->ms;
unsigned long cumulated_sz;
unsigned int score, max_score = 0;
- if (!quota->ms && !quota->sz && !quota->goal.get_score &&
- list_empty("a->goals))
+ if (!quota->ms && !quota->sz && list_empty("a->goals))
return;
/* New charge window starts */