Home | History | Annotate | Download | only in include

Lines Matching refs:pair

105 static void tst_fzsync_pair_info(struct tst_fzsync_pair *pair)
109 pair->avg_diff, pair->avg_dev, pair->delay);
117 static inline void tst_fzsync_delay_a(struct tst_fzsync_pair *pair)
119 volatile long spin_delay = pair->delay;
130 static inline void tst_fzsync_delay_b(struct tst_fzsync_pair *pair)
132 volatile long spin_delay = pair->delay;
148 static inline void tst_fzsync_time_a(struct tst_fzsync_pair *pair)
150 tst_fzsync_time(&pair->a);
158 static inline void tst_fzsync_time_b(struct tst_fzsync_pair *pair)
160 tst_fzsync_time(&pair->b);
181 * @pair: The state necessary for calculating the delay
194 static void tst_fzsync_pair_update(int loop_index, struct tst_fzsync_pair *pair)
197 long inc = pair->delay_inc;
198 float target = pair->avg_diff_trgt;
199 float avg = pair->avg_diff;
201 diff = pair->a.tv_nsec - pair->b.tv_nsec
202 + 1000000000 * (pair->a.tv_sec - pair->b.tv_sec);
203 avg = tst_exp_moving_avg(pair->avg_alpha, diff, avg);
204 pair->avg_dev = tst_exp_moving_avg(pair->avg_alpha,
206 pair->avg_dev);
208 if (!(loop_index & pair->update_gap)) {
210 pair->delay -= inc;
212 pair->delay += inc;
215 if (!(loop_index & pair->info_gap))
216 tst_fzsync_pair_info(pair);
218 pair->avg_diff = avg;
234 static inline int tst_fzsync_pair_wait(struct tst_fzsync_pair *pair,
247 && !tst_atomic_load(&pair->exit))
256 && !tst_atomic_load(&pair->exit))
264 && !tst_atomic_load(&pair->exit))
269 return !tst_atomic_load(&pair->exit) ||
273 static inline int tst_fzsync_wait_a(struct tst_fzsync_pair *pair)
275 return tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
278 static inline int tst_fzsync_wait_b(struct tst_fzsync_pair *pair)
280 return tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
301 static inline int tst_fzsync_wait_update_a(struct tst_fzsync_pair *pair)
305 tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
307 tst_fzsync_pair_update(loop_index, pair);
308 return tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
311 static inline int tst_fzsync_wait_update_b(struct tst_fzsync_pair *pair)
313 tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
314 return tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
323 static inline void tst_fzsync_pair_exit(struct tst_fzsync_pair *pair)
325 tst_atomic_store(1, &pair->exit);