Lines Matching refs:s
121 void damon_add_scheme(struct damon_ctx *ctx, struct damos *s) in damon_add_scheme() argument
123 list_add_tail(&s->list, &ctx->schemes); in damon_add_scheme()
126 static void damon_del_scheme(struct damos *s) in damon_del_scheme() argument
128 list_del(&s->list); in damon_del_scheme()
131 static void damon_free_scheme(struct damos *s) in damon_free_scheme() argument
133 kfree(s); in damon_free_scheme()
136 void damon_destroy_scheme(struct damos *s) in damon_destroy_scheme() argument
138 damon_del_scheme(s); in damon_destroy_scheme()
139 damon_free_scheme(s); in damon_destroy_scheme()
239 struct damos *s, *next_s; in damon_destroy_ctx() local
243 damon_for_each_scheme_safe(s, next_s, ctx) in damon_destroy_ctx()
244 damon_destroy_scheme(s); in damon_destroy_ctx()
327 struct damos *s, *next; in damon_set_schemes() local
330 damon_for_each_scheme_safe(s, next, ctx) in damon_set_schemes()
331 damon_destroy_scheme(s); in damon_set_schemes()
536 static bool __damos_valid_target(struct damon_region *r, struct damos *s) in __damos_valid_target() argument
541 return s->min_sz_region <= sz && sz <= s->max_sz_region && in __damos_valid_target()
542 s->min_nr_accesses <= r->nr_accesses && in __damos_valid_target()
543 r->nr_accesses <= s->max_nr_accesses && in __damos_valid_target()
544 s->min_age_region <= r->age && r->age <= s->max_age_region; in __damos_valid_target()
548 struct damon_region *r, struct damos *s) in damos_valid_target() argument
550 bool ret = __damos_valid_target(r, s); in damos_valid_target()
552 if (!ret || !s->quota.esz || !c->primitive.get_scheme_score) in damos_valid_target()
555 return c->primitive.get_scheme_score(c, t, r, s) >= s->quota.min_score; in damos_valid_target()
562 struct damos *s; in damon_do_apply_schemes() local
564 damon_for_each_scheme(s, c) { in damon_do_apply_schemes()
565 struct damos_quota *quota = &s->quota; in damon_do_apply_schemes()
570 if (!s->wmarks.activated) in damon_do_apply_schemes()
608 if (!damos_valid_target(c, t, r, s)) in damon_do_apply_schemes()
622 sz_applied = c->primitive.apply_scheme(c, t, r, s); in damon_do_apply_schemes()
632 if (s->action != DAMOS_STAT) in damon_do_apply_schemes()
636 s->stat.nr_tried++; in damon_do_apply_schemes()
637 s->stat.sz_tried += sz; in damon_do_apply_schemes()
639 s->stat.nr_applied++; in damon_do_apply_schemes()
640 s->stat.sz_applied += sz_applied; in damon_do_apply_schemes()
671 struct damos *s; in kdamond_apply_schemes() local
673 damon_for_each_scheme(s, c) { in kdamond_apply_schemes()
674 struct damos_quota *quota = &s->quota; in kdamond_apply_schemes()
678 if (!s->wmarks.activated) in kdamond_apply_schemes()
689 s->stat.qt_exceeds++; in kdamond_apply_schemes()
703 if (!__damos_valid_target(r, s)) in kdamond_apply_schemes()
706 c, t, r, s); in kdamond_apply_schemes()
980 struct damos *s; in kdamond_wait_activation() local
985 damon_for_each_scheme(s, ctx) { in kdamond_wait_activation()
986 wait_time = damos_wmark_wait_us(s); in kdamond_wait_activation()