Lines Matching defs:spin
84 static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin)
90 switch (spin) {
115 * b. Check if we have a spin value that produces a repeating subsequence.
117 * be > 0. If we do have such a spin:
120 * ii. If it reaches zero, add "+1" to the spin and reset the cycle_length
134 __lfsr_next(fl, fl->spin + 1);
137 __lfsr_next(fl, fl->spin);
177 * [1]: ((2^n - 1) * i) % (spin + 1) == 0,
178 * where "n" is LFSR's bits and "i" any number within the range [1,spin]
180 * It is important to know beforehand if a spin can cause a repetition of a
184 * [2]: (2^n - 1) -> (x * (spin + 1) + y), where x >= 0 and 0 <= y <= spin
186 * Thus, [1] is equivalent to (y * i) % (spin + 1) == 0;
187 * Also, the cycle's length will be (x * i) + (y * i) / (spin + 1)
189 static int prepare_spin(struct fio_lfsr *fl, unsigned int spin)
195 if (spin > 15)
198 x = max / (spin + 1);
199 y = max % (spin + 1);
201 fl->spin = spin;
203 for (i = 1; i <= spin; i++) {
204 if ((y * i) % (spin + 1) == 0) {
205 fl->cycle_length = (x * i) + (y * i) / (spin + 1);
235 unsigned int spin)
247 if (prepare_spin(fl, spin))