[S] Change in osmocom-bb[master]: Set sched RR Priority on main thread
pespin has uploaded this change for review. ( 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(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/17/39817/1 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: newchange Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I6aa22125e7de4f472d691b271639d5bee25762cb Gerrit-Change-Number: 39817 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de>
participants (1)
-
pespin