tbf/sched: We pick the _last_ entry, rotate the lists

We always pick the _last_ entry from the lists. Let's rotate
so we make it a bit more fair.
This commit is contained in:
Holger Hans Peter Freyther 2013-11-26 13:08:12 +01:00
parent 7f3e662b34
commit 7a5f3c2153
3 changed files with 13 additions and 0 deletions

View File

@ -133,6 +133,7 @@ static struct msgb *sched_select_ctrl_msg(struct gprs_rlcmac_bts *bts,
}
/* any message */
if (msg) {
tbf->rotate_in_list();
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling control "
"message at RTS for %s (TRX=%d, TS=%d)\n",
tbf_name(tbf), trx, ts);

View File

@ -1742,3 +1742,12 @@ bool gprs_rlcmac_tbf::dl_window_stalled() const
{
return dir.dl.window.window_stalled();
}
void gprs_rlcmac_tbf::rotate_in_list()
{
llist_del(&list);
if (direction == GPRS_RLCMAC_UL_TBF)
llist_add(&list, &bts->bts_data()->ul_tbfs);
else
llist_add(&list, &bts->bts_data()->dl_tbfs);
}

View File

@ -135,6 +135,9 @@ struct gprs_rlcmac_tbf {
uint16_t sns() const;
/* attempt to make things a bit more fair */
void rotate_in_list();
struct llist_head list;
uint32_t state_flags;
enum gprs_rlcmac_tbf_direction direction;