Lines Matching refs:dql
18 void dql_completed(struct dql *dql, unsigned int count) in dql_completed() argument
24 num_queued = READ_ONCE(dql->num_queued); in dql_completed()
27 BUG_ON(count > num_queued - dql->num_completed); in dql_completed()
29 completed = dql->num_completed + count; in dql_completed()
30 limit = dql->limit; in dql_completed()
31 ovlimit = POSDIFF(num_queued - dql->num_completed, limit); in dql_completed()
33 prev_inprogress = dql->prev_num_queued - dql->num_completed; in dql_completed()
34 all_prev_completed = AFTER_EQ(completed, dql->prev_num_queued); in dql_completed()
37 (dql->prev_ovlimit && all_prev_completed)) { in dql_completed()
53 limit += POSDIFF(completed, dql->prev_num_queued) + in dql_completed()
54 dql->prev_ovlimit; in dql_completed()
55 dql->slack_start_time = jiffies; in dql_completed()
56 dql->lowest_slack = UINT_MAX; in dql_completed()
82 slack = POSDIFF(limit + dql->prev_ovlimit, in dql_completed()
83 2 * (completed - dql->num_completed)); in dql_completed()
84 slack_last_objs = dql->prev_ovlimit ? in dql_completed()
85 POSDIFF(dql->prev_last_obj_cnt, dql->prev_ovlimit) : 0; in dql_completed()
89 if (slack < dql->lowest_slack) in dql_completed()
90 dql->lowest_slack = slack; in dql_completed()
93 dql->slack_start_time + dql->slack_hold_time)) { in dql_completed()
94 limit = POSDIFF(limit, dql->lowest_slack); in dql_completed()
95 dql->slack_start_time = jiffies; in dql_completed()
96 dql->lowest_slack = UINT_MAX; in dql_completed()
101 limit = clamp(limit, dql->min_limit, dql->max_limit); in dql_completed()
103 if (limit != dql->limit) { in dql_completed()
104 dql->limit = limit; in dql_completed()
108 dql->adj_limit = limit + completed; in dql_completed()
109 dql->prev_ovlimit = ovlimit; in dql_completed()
110 dql->prev_last_obj_cnt = dql->last_obj_cnt; in dql_completed()
111 dql->num_completed = completed; in dql_completed()
112 dql->prev_num_queued = num_queued; in dql_completed()
116 void dql_reset(struct dql *dql) in dql_reset() argument
119 dql->limit = 0; in dql_reset()
120 dql->num_queued = 0; in dql_reset()
121 dql->num_completed = 0; in dql_reset()
122 dql->last_obj_cnt = 0; in dql_reset()
123 dql->prev_num_queued = 0; in dql_reset()
124 dql->prev_last_obj_cnt = 0; in dql_reset()
125 dql->prev_ovlimit = 0; in dql_reset()
126 dql->lowest_slack = UINT_MAX; in dql_reset()
127 dql->slack_start_time = jiffies; in dql_reset()
131 void dql_init(struct dql *dql, unsigned int hold_time) in dql_init() argument
133 dql->max_limit = DQL_MAX_LIMIT; in dql_init()
134 dql->min_limit = 0; in dql_init()
135 dql->slack_hold_time = hold_time; in dql_init()
136 dql_reset(dql); in dql_init()