DLSCH sched: Fix coefficients for UE list ordering
Update the comparator() to properly sort UEs based on their coefficient
by appliey a consistent logic of -1/0/1 (see man qsort) for
smaller/equal/larger. The previous logic was only sorting based on 0/1
(equal/larger), which would result in some UEs with a high coefficient
not necessarily advancing to the start of the list, which could reduce
the likelihood of them being scheduled when they actually should (in
other words, this should improve fairness).
See also: 62e4025bc8 ("Integrate inactivity scheduling into main
allocation loop")
This commit is contained in:
@@ -594,8 +594,15 @@ typedef struct UEsched_s {
|
||||
NR_UE_info_t * UE;
|
||||
} UEsched_t;
|
||||
|
||||
static int comparator(const void *p, const void *q) {
|
||||
return ((UEsched_t*)p)->coef < ((UEsched_t*)q)->coef;
|
||||
static int comparator(const void *p, const void *q)
|
||||
{
|
||||
const UEsched_t *pp = p;
|
||||
const UEsched_t *qq = q;
|
||||
if (pp->coef < qq->coef)
|
||||
return 1;
|
||||
else if (pp->coef > qq->coef)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pf_dl(module_id_t module_id,
|
||||
|
||||
Reference in New Issue
Block a user