pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27936 )
Change subject: paging: Rework timer lifecycle logic
......................................................................
paging: Rework timer lifecycle logic
Decouple credit_timer from event "available_slots became 0".
Let's actually relate credit_timer to the fact of not receiving CCCH
Load Indication: If no CCCH Load Indication is received (cch_load_ind_period * 2),
then assume we are below CCH Load Indication threshold (10% load) and
start estimating the available_slots in a cch_load_ind_period*2 time
frame.
Moreover, in paging_schedule_if_needed(), there's no use in delaying
start of processing work if the work_timer is not already doing work.
Related: OS#5537
Change-Id: I6a0da03c408270044079e81d431f6641527c00cd
---
M src/osmo-bsc/paging.c
1 file changed, 12 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/36/27936/1
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 5be7d81..214587d 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -58,8 +58,6 @@
void *tall_paging_ctx = NULL;
-#define PAGING_TIMER 0, 500000
-
/* How many paging requests to Tx on RSL at max before going back to main loop */
#define MAX_PAGE_REQ_PER_ITER 20
@@ -106,17 +104,16 @@
log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
}
+static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts);
+
static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts)
{
- if (llist_empty(&paging_bts->pending_requests))
- return;
-
+ /* paging_handle_pending_requests() will schedule work_timer if work
+ * needs to be partitioned in several iterations. */
if (!osmo_timer_pending(&paging_bts->work_timer))
- osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER);
+ paging_handle_pending_requests(paging_bts);
}
-
-static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts);
static void paging_give_credit(void *data)
{
struct gsm_bts_paging_state *paging_bts_st = data;
@@ -210,16 +207,11 @@
struct gsm_paging_request, entry);
request = initial_request;
do {
- /*
- * In case the BTS does not provide us with load indication and we
- * ran out of slots, call an autofill routine. It might be that the
- * BTS did not like our paging messages and then we have counted down
- * to zero and we do not get any messages.
+ /* We run out of available slots. Wait until next CCCH Load Ind
+ * arrives or credit_timer triggers to keep processing requests.
*/
- if (paging_bts->available_slots == 0) {
- osmo_timer_schedule(&paging_bts->credit_timer, bts->ccch_load_ind_period * 2, 0);
+ if (paging_bts->available_slots == 0)
return;
- }
/* we need to determine the number of free channels */
if (paging_bts->free_chans_need != -1 &&
@@ -244,7 +236,7 @@
/* Once done iterating, prepare next scheduling: */
sched_next_iter:
- osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER);
+ osmo_timer_schedule(&paging_bts->work_timer, 0, 500000);
}
static void paging_worker(void *data)
@@ -263,6 +255,7 @@
INIT_LLIST_HEAD(&bts->paging.pending_requests);
osmo_timer_setup(&bts->paging.work_timer, paging_worker, &bts->paging);
osmo_timer_setup(&bts->paging.credit_timer, paging_give_credit, &bts->paging);
+ osmo_timer_schedule(&bts->paging.credit_timer, bts->ccch_load_ind_period * 2, 0);
}
/* Called upon the bts struct being freed */
@@ -502,10 +495,10 @@
/*! Update the BTS paging buffer slots on given BTS */
void paging_update_buffer_space(struct gsm_bts *bts, uint16_t free_slots)
{
-
- osmo_timer_del(&bts->paging.credit_timer);
bts->paging.available_slots = free_slots;
paging_schedule_if_needed(&bts->paging);
+ /* Re-arm credit_timer */
+ osmo_timer_schedule(&bts->paging.credit_timer, bts->ccch_load_ind_period * 2, 0);
}
/*! Count the number of pending paging requests on given BTS */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27936
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6a0da03c408270044079e81d431f6641527c00cd
Gerrit-Change-Number: 27936
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: osmith, pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27923 )
Change subject: osmobts: list all features of latest osmobts
......................................................................
Patch Set 2:
(1 comment)
File src/osmo-bsc/bts_trx_vty.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27923/comment/ed9d444a_47afb36e
PS2, Line 347: * connected yet (thus not sent the feature vector), so we cannot know for
I think this entire [existing] logic is flawed. Until the BTS conntext we don't know for sure, so printing warnings or even failing to start based on what we expect a recent software would support is ... weird.
If we don't know something, we should be silent about it. And once we know that information, we can report warnings,errors or whatever.
I'm not saying this should happen within this patch.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27923
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7fca42a39a4bc98a6ea8b9cfab28c4bad3a6a0aa
Gerrit-Change-Number: 27923
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 17:05:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27933 )
Change subject: Introduce VTY command 'ccch load-indication-period <0-256>'
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> yes :) src/osmo-bsc/cbch_scheduler. […]
doesn't look like it makes any assumptions at first sight. If there's no load indication it should continue to send one page every 1.88292 seconds based on the timer.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id9d23238863c02a72bcf32942f6b0d40be127904
Gerrit-Change-Number: 27933
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 17:00:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment