<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/23368">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bts-trx: reorder first timerfd schedule to decrease first timeout skew<br><br>By reordering the instruction, we scheduler the timerfd prior to<br>processing the FN on the upper layers. This means the first timerfd<br>expiration even will happen more inline with the expected time, that is,<br>CLOCK IND time + GSM_TDMA_FN_DURATION_nS.<br><br>Let T(trx_sched_fn) be the time spent executing function trx_sched_fn().<br>With previous order, the timerfd would have been scheduled later, which<br>in the end would mean expiration would happen at time CLOCK_IND +<br>GSM_TDMA_FN_DURATION_nS + T(trx_sched_fn), hence ending up with an extra<br>skew of T(trx_sched_fn) added by ourselves.<br>This extra skew added may be important specially at startup time (when<br>this code path is used), since usually the load in the system is high<br>and skew is usually already higher, which means helping crossing<br>unacceptable thresholds which may end up in osmo-bts-trx stopping with<br>"No clock from osmo-trx" reason.<br><br>Change-Id: Ie2ba35cd87f0bd4078ac3b4b5ec2eacad36c4258<br>---<br>M src/osmo-bts-trx/scheduler_trx.c<br>1 file changed, 3 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/23368/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>index 6e54d43..efd4954 100644</span><br><span>--- a/src/osmo-bts-trx/scheduler_trx.c</span><br><span>+++ b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>@@ -369,15 +369,14 @@</span><br><span> static int trx_setup_clock(struct gsm_bts *bts, struct osmo_trx_clock_state *tcs,</span><br><span>       struct timespec *tv_now, const struct timespec *interval, uint32_t fn)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-     tcs->last_fn_timer.fn = fn;</span><br><span style="color: hsl(0, 100%, 40%);">-  /* call trx cheduler function for new 'last' FN */</span><br><span style="color: hsl(0, 100%, 40%);">-      trx_sched_fn(bts, tcs->last_fn_timer.fn);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>         /* schedule first FN clock timer */</span><br><span>  osmo_timerfd_setup(&tcs->fn_timer_ofd, trx_fn_timer_cb, bts);</span><br><span>         osmo_timerfd_schedule(&tcs->fn_timer_ofd, NULL, interval);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ tcs->last_fn_timer.fn = fn;</span><br><span>       tcs->last_fn_timer.tv = *tv_now;</span><br><span style="color: hsl(120, 100%, 40%);">+   /* call trx scheduler function for new 'last' FN */</span><br><span style="color: hsl(120, 100%, 40%);">+   trx_sched_fn(bts, tcs->last_fn_timer.fn);</span><br><span> </span><br><span>     return 0;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/23368">change 23368</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/23368"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie2ba35cd87f0bd4078ac3b4b5ec2eacad36c4258 </div>
<div style="display:none"> Gerrit-Change-Number: 23368 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>