Lines Matching refs:scheme
283 struct damos *scheme; in damon_new_scheme() local
285 scheme = kmalloc(sizeof(*scheme), GFP_KERNEL); in damon_new_scheme()
286 if (!scheme) in damon_new_scheme()
288 scheme->pattern = *pattern; in damon_new_scheme()
289 scheme->action = action; in damon_new_scheme()
290 scheme->stat = (struct damos_stat){}; in damon_new_scheme()
291 INIT_LIST_HEAD(&scheme->list); in damon_new_scheme()
293 scheme->quota = *(damos_quota_init_priv(quota)); in damon_new_scheme()
295 scheme->wmarks = *wmarks; in damon_new_scheme()
296 scheme->wmarks.activated = true; in damon_new_scheme()
298 return scheme; in damon_new_scheme()
1070 static unsigned long damos_wmark_wait_us(struct damos *scheme) in damos_wmark_wait_us() argument
1074 if (scheme->wmarks.metric == DAMOS_WMARK_NONE) in damos_wmark_wait_us()
1077 metric = damos_wmark_metric_value(scheme->wmarks.metric); in damos_wmark_wait_us()
1079 if (metric > scheme->wmarks.high || scheme->wmarks.low > metric) { in damos_wmark_wait_us()
1080 if (scheme->wmarks.activated) in damos_wmark_wait_us()
1082 scheme->action, in damos_wmark_wait_us()
1083 metric > scheme->wmarks.high ? in damos_wmark_wait_us()
1085 scheme->wmarks.activated = false; in damos_wmark_wait_us()
1086 return scheme->wmarks.interval; in damos_wmark_wait_us()
1090 if ((scheme->wmarks.high >= metric && metric >= scheme->wmarks.mid) && in damos_wmark_wait_us()
1091 !scheme->wmarks.activated) in damos_wmark_wait_us()
1092 return scheme->wmarks.interval; in damos_wmark_wait_us()
1094 if (!scheme->wmarks.activated) in damos_wmark_wait_us()
1095 pr_debug("activate a scheme (%d)\n", scheme->action); in damos_wmark_wait_us()
1096 scheme->wmarks.activated = true; in damos_wmark_wait_us()