Lines Matching full:grp
102 * grp->index is the index of the group; and grp->slot_shift
151 struct qfq_group *grp; member
297 if (agg->grp == NULL) { in qfq_update_agg()
300 agg->grp = &q->groups[i]; in qfq_update_agg()
741 * First compute eligibility comparing grp->S, q->V,
744 static int qfq_calc_state(struct qfq_sched *q, const struct qfq_group *grp) in qfq_calc_state() argument
747 unsigned int state = qfq_gt(grp->S, q->V); in qfq_calc_state()
748 unsigned long mask = mask_from(q->bitmaps[ER], grp->index); in qfq_calc_state()
753 if (qfq_gt(grp->F, next->F)) in qfq_calc_state()
874 static void qfq_slot_insert(struct qfq_group *grp, struct qfq_aggregate *agg, in qfq_slot_insert() argument
877 u64 slot = (roundedS - grp->S) >> grp->slot_shift; in qfq_slot_insert()
881 u64 deltaS = roundedS - grp->S - in qfq_slot_insert()
882 ((u64)(QFQ_MAX_SLOTS - 2)<<grp->slot_shift); in qfq_slot_insert()
888 i = (grp->front + slot) % QFQ_MAX_SLOTS; in qfq_slot_insert()
890 hlist_add_head(&agg->next, &grp->slots[i]); in qfq_slot_insert()
891 __set_bit(slot, &grp->full_slots); in qfq_slot_insert()
895 static struct qfq_aggregate *qfq_slot_head(struct qfq_group *grp) in qfq_slot_head() argument
897 return hlist_entry(grp->slots[grp->front].first, in qfq_slot_head()
904 static void qfq_front_slot_remove(struct qfq_group *grp) in qfq_front_slot_remove() argument
906 struct qfq_aggregate *agg = qfq_slot_head(grp); in qfq_front_slot_remove()
910 if (hlist_empty(&grp->slots[grp->front])) in qfq_front_slot_remove()
911 __clear_bit(0, &grp->full_slots); in qfq_front_slot_remove()
919 static struct qfq_aggregate *qfq_slot_scan(struct qfq_group *grp) in qfq_slot_scan() argument
923 pr_debug("qfq slot_scan: grp %u full %#lx\n", in qfq_slot_scan()
924 grp->index, grp->full_slots); in qfq_slot_scan()
926 if (grp->full_slots == 0) in qfq_slot_scan()
929 i = __ffs(grp->full_slots); /* zero based */ in qfq_slot_scan()
931 grp->front = (grp->front + i) % QFQ_MAX_SLOTS; in qfq_slot_scan()
932 grp->full_slots >>= i; in qfq_slot_scan()
935 return qfq_slot_head(grp); in qfq_slot_scan()
947 static void qfq_slot_rotate(struct qfq_group *grp, u64 roundedS) in qfq_slot_rotate() argument
949 unsigned int i = (grp->S - roundedS) >> grp->slot_shift; in qfq_slot_rotate()
951 grp->full_slots <<= i; in qfq_slot_rotate()
952 grp->front = (grp->front - i) % QFQ_MAX_SLOTS; in qfq_slot_rotate()
957 struct qfq_group *grp; in qfq_update_eligible() local
963 grp = qfq_ffs(q, ineligible); in qfq_update_eligible()
964 if (qfq_gt(grp->S, q->V)) in qfq_update_eligible()
965 q->V = grp->S; in qfq_update_eligible()
1033 int slot_shift = agg->grp->slot_shift; in qfq_update_start()
1040 mask = mask_from(q->bitmaps[ER], agg->grp->index); in qfq_update_start()
1154 struct qfq_group *grp; in qfq_choose_next_agg() local
1164 grp = qfq_ffs(q, q->bitmaps[ER]); in qfq_choose_next_agg()
1165 old_F = grp->F; in qfq_choose_next_agg()
1167 agg = qfq_slot_head(grp); in qfq_choose_next_agg()
1170 qfq_front_slot_remove(grp); in qfq_choose_next_agg()
1172 new_front_agg = qfq_slot_scan(grp); in qfq_choose_next_agg()
1175 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_choose_next_agg()
1178 grp->slot_shift); in qfq_choose_next_agg()
1181 if (grp->S == roundedS) in qfq_choose_next_agg()
1183 grp->S = roundedS; in qfq_choose_next_agg()
1184 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_choose_next_agg()
1185 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_choose_next_agg()
1186 s = qfq_calc_state(q, grp); in qfq_choose_next_agg()
1187 __set_bit(grp->index, &q->bitmaps[s]); in qfq_choose_next_agg()
1190 qfq_unblock_groups(q, grp->index, old_F); in qfq_choose_next_agg()
1270 struct qfq_group *grp = agg->grp; in qfq_schedule_agg() local
1274 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_schedule_agg()
1278 * If agg->S >= grp->S we don't need to adjust the in qfq_schedule_agg()
1280 * Otherwise grp->S is decreasing, we must make room in qfq_schedule_agg()
1285 if (grp->full_slots) { in qfq_schedule_agg()
1286 if (!qfq_gt(grp->S, agg->S)) in qfq_schedule_agg()
1290 qfq_slot_rotate(grp, roundedS); in qfq_schedule_agg()
1292 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_schedule_agg()
1293 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_schedule_agg()
1298 grp->S = roundedS; in qfq_schedule_agg()
1299 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_schedule_agg()
1300 s = qfq_calc_state(q, grp); in qfq_schedule_agg()
1301 __set_bit(grp->index, &q->bitmaps[s]); in qfq_schedule_agg()
1310 qfq_slot_insert(grp, agg, roundedS); in qfq_schedule_agg()
1329 static void qfq_slot_remove(struct qfq_sched *q, struct qfq_group *grp, in qfq_slot_remove() argument
1335 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_slot_remove()
1336 offset = (roundedS - grp->S) >> grp->slot_shift; in qfq_slot_remove()
1338 i = (grp->front + offset) % QFQ_MAX_SLOTS; in qfq_slot_remove()
1341 if (hlist_empty(&grp->slots[i])) in qfq_slot_remove()
1342 __clear_bit(offset, &grp->full_slots); in qfq_slot_remove()
1354 struct qfq_group *grp = agg->grp; in qfq_deactivate_agg() local
1366 qfq_slot_remove(q, grp, agg); in qfq_deactivate_agg()
1368 if (!grp->full_slots) { in qfq_deactivate_agg()
1369 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_deactivate_agg()
1370 __clear_bit(grp->index, &q->bitmaps[EB]); in qfq_deactivate_agg()
1371 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_deactivate_agg()
1373 if (test_bit(grp->index, &q->bitmaps[ER]) && in qfq_deactivate_agg()
1374 !(q->bitmaps[ER] & ~((1UL << grp->index) - 1))) { in qfq_deactivate_agg()
1375 mask = q->bitmaps[ER] & ((1UL << grp->index) - 1); in qfq_deactivate_agg()
1383 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_deactivate_agg()
1384 } else if (hlist_empty(&grp->slots[grp->front])) { in qfq_deactivate_agg()
1385 agg = qfq_slot_scan(grp); in qfq_deactivate_agg()
1386 roundedS = qfq_round_down(agg->S, grp->slot_shift); in qfq_deactivate_agg()
1387 if (grp->S != roundedS) { in qfq_deactivate_agg()
1388 __clear_bit(grp->index, &q->bitmaps[ER]); in qfq_deactivate_agg()
1389 __clear_bit(grp->index, &q->bitmaps[IR]); in qfq_deactivate_agg()
1390 __clear_bit(grp->index, &q->bitmaps[EB]); in qfq_deactivate_agg()
1391 __clear_bit(grp->index, &q->bitmaps[IB]); in qfq_deactivate_agg()
1392 grp->S = roundedS; in qfq_deactivate_agg()
1393 grp->F = roundedS + (2ULL << grp->slot_shift); in qfq_deactivate_agg()
1394 s = qfq_calc_state(q, grp); in qfq_deactivate_agg()
1395 __set_bit(grp->index, &q->bitmaps[s]); in qfq_deactivate_agg()
1412 struct qfq_group *grp; in qfq_init_qdisc() local
1435 grp = &q->groups[i]; in qfq_init_qdisc()
1436 grp->index = i; in qfq_init_qdisc()
1437 grp->slot_shift = q->min_slot_shift + i; in qfq_init_qdisc()
1439 INIT_HLIST_HEAD(&grp->slots[j]); in qfq_init_qdisc()