paging: Replace reqs waiting for retransmission with new incoming inital req if queue is full

If queue size (in transmit delay of requests) is too long (above
threshold) when a new initial incoming request arrives, instead of
directly discarding it, see if we can drop a pending retransmission and
insert the new one instead, in order to avoid losing initial requests.

This is done under the assumption that it is more important to transmit
intial requests than to retransmit already transmitted ones. The
rationale is that there's lower chances that an MS which didn't answer
lately will answer now (aka being reachable at the cell), so it's better
to allocate resources for new requests (new MS) which may be available
in the cell.

Change-Id: Idfd93254ae456b1ee08416e05479488299dd063d
Related: OS#5552
This commit is contained in:
Pau Espin 2022-11-29 11:51:41 +01:00
parent e2438ade54
commit ae5166d5f0
2 changed files with 16 additions and 8 deletions

View File

@ -78,7 +78,8 @@ static struct osmo_tdef gsm_network_T_defs[] = {
{ .T = -3113, .default_val = PAGING_THRESHOLD_X3113_DEFAULT_SEC,
.desc = "Maximum Paging Request Transmit Delay Threshold: " \
"If the estimated transmit delay of the messages of the paging queue surpasses this threshold, new incoming "
"paging requests are discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. "
"paging requests will if possible replace a random request in retransmission state or otherwise be discarded, "
"hence limiting the size of the queue and maximum delay of its scheduled requests. "
"X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response" },
{ .T = -3210, .default_val = 20, .desc = "After L3 Complete, wait for MSC to confirm" },
{}

View File

@ -504,13 +504,6 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ATTEMPTED));
/* Don't try to queue more requests than we can realistically handle within X3113 seconds,
* see PAGING_THRESHOLD_X3113_DEFAULT_SEC. */
if (paging_pending_requests_nr(bts) > paging_estimate_available_slots(bts, x3113_s)) {
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_OVERLOAD));
return -ENOSPC;
}
/* Find if we already have one for the given subscriber on this BTS: */
if (bsc_subscr_find_req_by_bts(params->bsub, bts)) {
LOG_PAGING_BTS(params, bts, DPAG, LOGL_INFO, "Paging request already pending for this subscriber\n");
@ -518,6 +511,20 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
return -EEXIST;
}
/* Don't try to queue more requests than we can realistically handle within X3113 seconds,
* see PAGING_THRESHOLD_X3113_DEFAULT_SEC. */
if (paging_pending_requests_nr(bts) > paging_estimate_available_slots(bts, x3113_s)) {
struct gsm_paging_request *first_retrans_req;
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_OVERLOAD));
/* Need to drop a retrans from the queue if possible, in order to make space for the new initial req. */
if (bts_entry->retrans_req_list_len == 0) {
/* There are no retrans to be replaced by this initial request, discard it. */
return -ENOSPC;
}
first_retrans_req = llist_first_entry(&bts_entry->retrans_req_list, struct gsm_paging_request, entry);
paging_remove_request(first_retrans_req);
}
/* The incoming new req will be stored in initial_req_list giving higher prio
* to it over retransmissions. This avoids new subscribers being paged to
* be delayed if the paging queue is full due to a lot of retranmissions.