Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email )
Change subject: fake_trx: Allow setting sched RR priority for clckgen thread
......................................................................
Patch Set 3:
(1 comment)
File src/target/trx_toolkit/clck_gen.py:
https://gerrit.osmocom.org/c/osmocom-bb/+/39815/comment/0ea07683_6dc1900e?u… :
PS3, Line 73: self._thread.sched_rr_prio = self.sched_rr_prio
> Sorry I didn't see your comment before merging. […]
As you can see from existing code, the worker has access to `self.ctr_interval`, `self._breaker`, and `self.send_clck_ind()`. So your understanding is incorrect. Please submit a separate patch removing this line.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3c7f36c17fc7b9cae1023b4a0ed37f983dc286dc
Gerrit-Change-Number: 39815
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 19:53:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39821?usp=email )
Change subject: bts: Run osmo-bts-trx with sched_rr priority
......................................................................
bts: Run osmo-bts-trx with sched_rr priority
use a real time prio since it really needs to do stuff in ral time with
high prio. Use lower rt prio than fake_trx since that one is the most
important piece providing clock.
Change-Id: I0251ed3ec0645617cf4e9bcc03e75c805bf1634c
---
M bts/osmo-bts.cfg
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/bts/osmo-bts.cfg b/bts/osmo-bts.cfg
index e80f51b..a683a03 100644
--- a/bts/osmo-bts.cfg
+++ b/bts/osmo-bts.cfg
@@ -32,6 +32,9 @@
no login
bind 127.0.0.1
!
+cpu-sched
+ policy rr 10
+!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39821?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0251ed3ec0645617cf4e9bcc03e75c805bf1634c
Gerrit-Change-Number: 39821
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email )
Change subject: fake_trx: Allow setting sched RR priority for clckgen thread
......................................................................
Patch Set 3:
(1 comment)
File src/target/trx_toolkit/clck_gen.py:
https://gerrit.osmocom.org/c/osmocom-bb/+/39815/comment/89bc1b3d_65839b44?u… :
PS3, Line 73: self._thread.sched_rr_prio = self.sched_rr_prio
> Why is this needed? You're already setting `self. […]
Sorry I didn't see your comment before merging.
AFAIU this class is a separate object from the internal thread object which can be accessed through the _worker()? Or am I wrong? It's been a while since I last wrote python :)
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3c7f36c17fc7b9cae1023b4a0ed37f983dc286dc
Gerrit-Change-Number: 39815
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 19:50:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39817?usp=email )
Change subject: Set sched RR Priority on main thread
......................................................................
Set sched RR Priority on main thread
Since we are still affected by Python GIL, it makes sense to also set
the main thread (which is actually also expected to be real time) to a
real time priority.
Use a slightly higher rr prio (prio + 1) to the clckgen thread.
Change-Id: I6aa22125e7de4f472d691b271639d5bee25762cb
---
M src/target/trx_toolkit/fake_trx.py
1 file changed, 10 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index ddeb083..8f187ac 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -27,6 +27,7 @@
import select
import sys
import re
+import os
from app_common import ApplicationBase
from burst_fwd import BurstForwarder
@@ -397,7 +398,7 @@
self.trx_list = TRXList()
# Init shared clock generator
- self.clck_gen = CLCKGen([], sched_rr_prio = self.argv.sched_rr_prio)
+ self.clck_gen = CLCKGen([], sched_rr_prio = None if self.argv.sched_rr_prio is None else self.argv.sched_rr_prio + 1)
# This method will be called on each TDMA frame
self.clck_gen.clck_handler = self.clck_handler
@@ -450,6 +451,14 @@
trx_parent.child_trx_list.add_trx(trx_child)
def run(self):
+ if self.argv.sched_rr_prio is not None:
+ sched_param = os.sched_param(self.argv.sched_rr_prio)
+ try:
+ log.info("Setting real time process scheduler to SCHED_RR, priority %u" % (self.argv.sched_rr_prio))
+ os.sched_setscheduler(0, os.SCHED_RR, sched_param)
+ except OSError:
+ log.error("Failed to set real time process scheduler to SCHED_RR, priority %u" % (self.argv.sched_rr_prio))
+
# Compose list of to be monitored sockets
sock_list = []
for trx in self.trx_list.trx_list:
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39817?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6aa22125e7de4f472d691b271639d5bee25762cb
Gerrit-Change-Number: 39817
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email )
Change subject: fake_trx: Allow setting sched RR priority for clckgen thread
......................................................................
fake_trx: Allow setting sched RR priority for clckgen thread
With this patch python is still too slow sometimes, with frecuent
overruns in the range 50-2400 microsecs. Still, with higher prio we
should hopefully see less cases where the process is being delayed by a
much higher amount, which may trigger a "no clock" error from
osmo-bts-trx.
Change-Id: I3c7f36c17fc7b9cae1023b4a0ed37f983dc286dc
---
M src/target/trx_toolkit/clck_gen.py
M src/target/trx_toolkit/fake_trx.py
2 files changed, 17 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/target/trx_toolkit/clck_gen.py b/src/target/trx_toolkit/clck_gen.py
index c6da8f6..f73ac16 100755
--- a/src/target/trx_toolkit/clck_gen.py
+++ b/src/target/trx_toolkit/clck_gen.py
@@ -24,6 +24,7 @@
import threading
import time
import signal
+import os
from app_common import ApplicationBase
from udp_link import UDPLink
@@ -34,7 +35,7 @@
SEC_DELAY_US = 1000 * 1000
GSM_FRAME_US = 4615.0
- def __init__(self, clck_links, clck_start = 0, ind_period = 102):
+ def __init__(self, clck_links, clck_start = 0, ind_period = 102, sched_rr_prio = None):
# This event is needed to control the thread
self._breaker = threading.Event()
self._thread = None
@@ -50,6 +51,9 @@
# (Optional) clock consumer
self.clck_handler = None
+ # RR Scheduler priority of thread. None = don't set it.
+ self.sched_rr_prio = sched_rr_prio
+
@property
def running(self):
if self._thread is None:
@@ -66,6 +70,7 @@
# Initialize and start a new thread
self._thread = threading.Thread(target = self._worker)
self._thread.daemon = True
+ self._thread.sched_rr_prio = self.sched_rr_prio
self._thread.start()
def stop(self):
@@ -83,6 +88,13 @@
self._breaker.clear()
def _worker(self):
+ if self.sched_rr_prio is not None:
+ sched_param = os.sched_param(self.sched_rr_prio)
+ try:
+ log.info("CLCKGen: Setting real time process scheduler to SCHED_RR, priority %u" % (self.sched_rr_prio))
+ os.sched_setscheduler(0, os.SCHED_RR, sched_param)
+ except OSError:
+ log.error("CLCKGen: Failed to set real time process scheduler to SCHED_RR, priority %u" % (self.sched_rr_prio))
# run .send_clck_ind() every .ctr_interval
# be careful not to accumulate timing error when organizing the clock loop
ns = 1e-9
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index 21bd189..ddeb083 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -397,7 +397,7 @@
self.trx_list = TRXList()
# Init shared clock generator
- self.clck_gen = CLCKGen([])
+ self.clck_gen = CLCKGen([], sched_rr_prio = self.argv.sched_rr_prio)
# This method will be called on each TDMA frame
self.clck_gen.clck_handler = self.clck_handler
@@ -530,6 +530,9 @@
trx_group.add_argument("-p", "--bb-base-port",
dest = "bb_base_port", type = int, default = 6700,
help = "Set BB base port number (default %(default)s)")
+ trx_group.add_argument("-s", "--sched-rr-prio",
+ dest = "sched_rr_prio", type = int, default = None,
+ help = "Set Scheduler RR Priority (default None)")
mtrx_group = parser.add_argument_group("Additional transceivers")
mtrx_group.add_argument("--trx",
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3c7f36c17fc7b9cae1023b4a0ed37f983dc286dc
Gerrit-Change-Number: 39815
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39817?usp=email )
Change subject: Set sched RR Priority on main thread
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39817?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6aa22125e7de4f472d691b271639d5bee25762cb
Gerrit-Change-Number: 39817
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 19:48:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: daniel, kirr, laforge.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email )
Change subject: fake_trx: Allow setting sched RR priority for clckgen thread
......................................................................
Patch Set 3: Code-Review+2
(1 comment)
Patchset:
PS3:
> Maybe I'm missing something but was it considered to simply run fake_trx. […]
Yes, but I preferred having full control over each thread priority.
Moreover, we may want to add cpu pinning information in the future too, etc.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39815?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I3c7f36c17fc7b9cae1023b4a0ed37f983dc286dc
Gerrit-Change-Number: 39815
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: kirr <kirr(a)nexedi.com>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 19:48:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: kirr <kirr(a)nexedi.com>
Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39780?usp=email )
Change subject: ara_m: add command to lock write access to the ARA-M rules.
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File docs/shell.rst:
https://gerrit.osmocom.org/c/pysim/+/39780/comment/c4ac38ee_deb671d7?usp=em… :
PS2, Line 1022: NOTE: Proprietary feature that is specific to Bertrand Martel's ARA-M
"ARA-M Locking is a proprietary feature that is specific to sysmocom's fork of Bertrand Martel's ARA-M..." - or did Bertrand actually merge this upstream?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39780?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I71581a0c9f146f9a0921093d9b53b053b4a8946c
Gerrit-Change-Number: 39780
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 19:40:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes