Lines Matching defs:scheme

383 	struct damos *scheme;
385 scheme = kmalloc(sizeof(*scheme), GFP_KERNEL);
386 if (!scheme)
388 scheme->pattern = *pattern;
389 scheme->action = action;
390 scheme->apply_interval_us = apply_interval_us;
396 scheme->next_apply_sis = 0;
397 scheme->walk_completed = false;
398 INIT_LIST_HEAD(&scheme->filters);
399 INIT_LIST_HEAD(&scheme->ops_filters);
400 scheme->stat = (struct damos_stat){};
401 INIT_LIST_HEAD(&scheme->list);
403 scheme->quota = *(damos_quota_init(quota));
405 INIT_LIST_HEAD(&scheme->quota.goals);
407 scheme->wmarks = *wmarks;
408 scheme->wmarks.activated = true;
410 scheme->target_nid = target_nid;
412 return scheme;
1374 * invocation, for each scheme. The given callback function can hence safely
1376 * each of the scheme will apply the action for next interval, without
1377 * additional synchronizations against the kdamond. If every scheme of @ctx
1528 * @s: The scheme to be applied.
1530 * If a quota of a scheme has exceeded in a quota charge window, the scheme's
1532 * regions. To avoid applying the scheme action to only already applied
1533 * regions, DAMON skips applying the scheme action to the regions that charged
1665 * @s: The scheme of @ctx that will be applied to @r.
1668 * apply a DAMOS scheme action to a region. If a DAMOS walk request is
1690 * @s: A scheme of @ctx that all walks are now done.
1693 * scheme to all regions that eligible for the given &damos->apply_interval_us.
1694 * If every scheme of @ctx including @s now finished walking for at least one
1725 * walk is requested but there is no DAMOS scheme to walk for, or the kdamond
2312 * Returns zero if the scheme is active. Else, returns time to wait for next
2315 static unsigned long damos_wmark_wait_us(struct damos *scheme)
2319 if (damos_get_wmark_metric_value(scheme->wmarks.metric, &metric))
2323 if (metric > scheme->wmarks.high || scheme->wmarks.low > metric) {
2324 if (scheme->wmarks.activated)
2325 pr_debug("deactivate a scheme (%d) for %s wmark\n",
2326 scheme->action,
2327 str_high_low(metric > scheme->wmarks.high));
2328 scheme->wmarks.activated = false;
2329 return scheme->wmarks.interval;
2333 if ((scheme->wmarks.high >= metric && metric >= scheme->wmarks.mid) &&
2334 !scheme->wmarks.activated)
2335 return scheme->wmarks.interval;
2337 if (!scheme->wmarks.activated)
2338 pr_debug("activate a scheme (%d)\n", scheme->action);
2339 scheme->wmarks.activated = true;
2419 struct damos *scheme;
2428 damon_for_each_scheme(scheme, ctx) {
2429 apply_interval = scheme->apply_interval_us ?
2430 scheme->apply_interval_us : ctx->attrs.aggr_interval;
2431 scheme->next_apply_sis = apply_interval / sample_interval;
2432 damos_set_filters_default_reject(scheme);