Lines Matching full:grp

102  * grp->index is the index of the group; and grp->slot_shift
150 struct qfq_group *grp; member
301 if (agg->grp == NULL) { in qfq_update_agg()
304 agg->grp = &q->groups[i]; in qfq_update_agg()
743 * First compute eligibility comparing grp->S, q->V,
746 static int qfq_calc_state(struct qfq_sched *q, const struct qfq_group *grp) in qfq_calc_state() argument
749 unsigned int state = qfq_gt(grp->S, q->V); in qfq_calc_state()
750 unsigned long mask = mask_from(q->bitmaps[ER], grp->index); in qfq_calc_state()
755 if (qfq_gt(grp->F, next->F)) in qfq_calc_state()
876 static void qfq_slot_insert(struct qfq_group *grp, struct qfq_aggregate *agg, in qfq_slot_insert() argument
879 u64 slot = (roundedS - grp->S) >> grp->slot_shift; in qfq_slot_insert()
883 u64 deltaS = roundedS - grp->S - in qfq_slot_insert()
884 ((u64)(QFQ_MAX_SLOTS - 2)<<grp->slot_shift); in qfq_slot_insert()
890 i = (grp->front + slot) % QFQ_MAX_SLOTS; in qfq_slot_insert()
892 hlist_add_head(&agg->next, &grp->slots[i]); in qfq_slot_insert()
893 __set_bit(slot, &grp->full_slots); in qfq_slot_insert()
897 static struct qfq_aggregate *qfq_slot_head(struct qfq_group *grp) in qfq_slot_head() argument
899 return hlist_entry(grp->slots[grp->front].first, in qfq_slot_head()
906 static void qfq_front_slot_remove(struct qfq_group *grp) in qfq_front_slot_remove() argument
908 struct qfq_aggregate *agg = qfq_slot_head(grp); in qfq_front_slot_remove()
912 if (hlist_empty(&grp->slots[grp->front])) in qfq_front_slot_remove()
913 __clear_bit(0, &grp->full_slots); in qfq_front_slot_remove()
921 static struct qfq_aggregate *qfq_slot_scan(struct qfq_group *grp) in qfq_slot_scan() argument
925 pr_debug("qfq slot_scan: grp %u full %#lx\n", in qfq_slot_scan()
926 grp->index, grp->full_slots); in qfq_slot_scan()
928 if (grp->full_slots == 0) in qfq_slot_scan()
931 i = __ffs(grp->full_slots); /* zero based */ in qfq_slot_scan()
933 grp->front = (grp->front + i) % QFQ_MAX_SLOTS; in qfq_slot_scan()
934 grp->full_slots >>= i; in qfq_slot_scan()
937 return qfq_slot_head(grp); in qfq_slot_scan()
949 static void qfq_slot_rotate(struct qfq_group *grp, u64 roundedS) in qfq_slot_rotate() argument
951 unsigned int i = (grp->S - roundedS) >> grp->slot_shift; in qfq_slot_rotate()
953 grp->full_slots <<= i; in qfq_slot_rotate()
954 grp->front = (grp->front - i) % QFQ_MAX_SLOTS; in qfq_slot_rotate()
959 struct qfq_group *grp; in qfq_update_eligible() local
965 grp = qfq_ffs(q, ineligible); in qfq_update_eligible()
966 if (qfq_gt(grp->S, q->V)) in qfq_update_eligible()
967 q->V = grp->S; in qfq_update_eligible()
1040 int slot_shift = agg->grp->slot_shift; in qfq_update_start()
1047 mask = mask_from(q->bitmaps[ER], agg->grp->index); in qfq_update_start()
1168 struct qfq_group *grp; in qfq_choose_next_agg() local
1178 grp = qfq_ffs(q, q->bitmaps[ER]); in qfq_choose_next_agg()
1179 old_F = grp->F; in qfq_choose_next_agg()
1181 agg = qfq_slot_head(grp); in qfq_choose_next_agg()
1184 qfq_front_slot_remove(grp); in qfq_choose_next_agg()
1186 new_front_agg = qfq_slot_scan(grp); in qfq_choose_next_agg()
1189 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_choose_next_agg()
1192 grp->slot_shift); in qfq_choose_next_agg()
1195 if (grp->S == roundedS) in qfq_choose_next_agg()
1197 grp->S = roundedS; in qfq_choose_next_agg()
1198 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_choose_next_agg()
1199 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_choose_next_agg()
1200 s = qfq_calc_state(q, grp); in qfq_choose_next_agg()
1201 __set_bit(grp->index, &q->bitmaps[s]); in qfq_choose_next_agg()
1204 qfq_unblock_groups(q, grp->index, old_F); in qfq_choose_next_agg()
1283 struct qfq_group *grp = agg->grp; in qfq_schedule_agg() local
1287 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_schedule_agg()
1291 * If agg->S >= grp->S we don't need to adjust the in qfq_schedule_agg()
1293 * Otherwise grp->S is decreasing, we must make room in qfq_schedule_agg()
1298 if (grp->full_slots) { in qfq_schedule_agg()
1299 if (!qfq_gt(grp->S, agg->S)) in qfq_schedule_agg()
1303 qfq_slot_rotate(grp, roundedS); in qfq_schedule_agg()
1305 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_schedule_agg()
1306 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_schedule_agg()
1311 grp->S = roundedS; in qfq_schedule_agg()
1312 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_schedule_agg()
1313 s = qfq_calc_state(q, grp); in qfq_schedule_agg()
1314 __set_bit(grp->index, &q->bitmaps[s]); in qfq_schedule_agg()
1323 qfq_slot_insert(grp, agg, roundedS); in qfq_schedule_agg()
1342 static void qfq_slot_remove(struct qfq_sched *q, struct qfq_group *grp, in qfq_slot_remove() argument
1348 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_slot_remove()
1349 offset = (roundedS - grp->S) >> grp->slot_shift; in qfq_slot_remove()
1351 i = (grp->front + offset) % QFQ_MAX_SLOTS; in qfq_slot_remove()
1354 if (hlist_empty(&grp->slots[i])) in qfq_slot_remove()
1355 __clear_bit(offset, &grp->full_slots); in qfq_slot_remove()
1367 struct qfq_group *grp = agg->grp; in qfq_deactivate_agg() local
1379 qfq_slot_remove(q, grp, agg); in qfq_deactivate_agg()
1381 if (!grp->full_slots) { in qfq_deactivate_agg()
1382 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_deactivate_agg()
1383 __clear_bit(grp->index, &q->bitmaps[EB]); in qfq_deactivate_agg()
1384 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_deactivate_agg()
1386 if (test_bit(grp->index, &q->bitmaps[ER]) && in qfq_deactivate_agg()
1387 !(q->bitmaps[ER] & ~((1UL << grp->index) - 1))) { in qfq_deactivate_agg()
1388 mask = q->bitmaps[ER] & ((1UL << grp->index) - 1); in qfq_deactivate_agg()
1396 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_deactivate_agg()
1397 } else if (hlist_empty(&grp->slots[grp->front])) { in qfq_deactivate_agg()
1398 agg = qfq_slot_scan(grp); in qfq_deactivate_agg()
1399 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_deactivate_agg()
1400 if (grp->S != roundedS) { in qfq_deactivate_agg()
1401 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_deactivate_agg()
1402 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_deactivate_agg()
1403 __clear_bit(grp->index, &q->bitmaps[EB]); in qfq_deactivate_agg()
1404 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_deactivate_agg()
1405 grp->S = roundedS; in qfq_deactivate_agg()
1406 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_deactivate_agg()
1407 s = qfq_calc_state(q, grp); in qfq_deactivate_agg()
1408 __set_bit(grp->index, &q->bitmaps[s]); in qfq_deactivate_agg()
1425 struct qfq_group *grp; in qfq_init_qdisc() local
1448 grp = &q->groups[i]; in qfq_init_qdisc()
1449 grp->index = i; in qfq_init_qdisc()
1450 grp->slot_shift = q->min_slot_shift + i; in qfq_init_qdisc()
1452 INIT_HLIST_HEAD(&grp->slots[j]); in qfq_init_qdisc()