Change in osmo-bts[master]: bts-trx: reorder first timerfd schedule to decrease first timeout skew

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Mar 16 10:05:18 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/23368 )

Change subject: bts-trx: reorder first timerfd schedule to decrease first timeout skew
......................................................................

bts-trx: reorder first timerfd schedule to decrease first timeout skew

By reordering the instruction, we scheduler the timerfd prior to
processing the FN on the upper layers. This means the first timerfd
expiration even will happen more inline with the expected time, that is,
CLOCK IND time + GSM_TDMA_FN_DURATION_nS.

Let T(trx_sched_fn) be the time spent executing function trx_sched_fn().
With previous order, the timerfd would have been scheduled later, which
in the end would mean expiration would happen at time CLOCK_IND +
GSM_TDMA_FN_DURATION_nS + T(trx_sched_fn), hence ending up with an extra
skew of T(trx_sched_fn) added by ourselves.
This extra skew added may be important specially at startup time (when
this code path is used), since usually the load in the system is high
and skew is usually already higher, which means helping crossing
unacceptable thresholds which may end up in osmo-bts-trx stopping with
"No clock from osmo-trx" reason.

Change-Id: Ie2ba35cd87f0bd4078ac3b4b5ec2eacad36c4258
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  Hoernchen: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 6e54d43..efd4954 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -369,15 +369,14 @@
 static int trx_setup_clock(struct gsm_bts *bts, struct osmo_trx_clock_state *tcs,
 	struct timespec *tv_now, const struct timespec *interval, uint32_t fn)
 {
-	tcs->last_fn_timer.fn = fn;
-	/* call trx cheduler function for new 'last' FN */
-	trx_sched_fn(bts, tcs->last_fn_timer.fn);
-
 	/* schedule first FN clock timer */
 	osmo_timerfd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts);
 	osmo_timerfd_schedule(&tcs->fn_timer_ofd, NULL, interval);
 
+	tcs->last_fn_timer.fn = fn;
 	tcs->last_fn_timer.tv = *tv_now;
+	/* call trx scheduler function for new 'last' FN */
+	trx_sched_fn(bts, tcs->last_fn_timer.fn);
 
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/23368
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie2ba35cd87f0bd4078ac3b4b5ec2eacad36c4258
Gerrit-Change-Number: 23368
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210316/176ea9cc/attachment.htm>


More information about the gerrit-log mailing list