Change in ...osmo-trx[master]: Drop old setPriority related code

laforge gerrit-no-reply at lists.osmocom.org
Fri Aug 23 06:55:10 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-trx/+/15258 )

Change subject: Drop old setPriority related code
......................................................................

Drop old setPriority related code

This code is not needed anymore since we are setting SCHED_RR scheduler
with a real time priority in main thread during startup, so all threads
will inherit same rt priority, which should be enough to keep the
process working reliably even on high system loads (from non rt
processes).

osmo-trx was tested to be reliable during test with stress-ng as
explained in related ticket below.

Related: OS#2344
Change-Id: I3a88946dd71e9aeeaac9d19d396e2236c302b608
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/device/common/radioDevice.h
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/uhd/UHDDevice.h
M Transceiver52M/device/usrp1/USRPDevice.h
M Transceiver52M/radioInterface.h
8 files changed, 0 insertions(+), 32 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 4da1876..2d5c04e 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -1126,8 +1126,6 @@
   snprintf(thread_name, 16, "RxUpper%zu", num);
   set_selfthread_name(thread_name);
 
-  trx->setPriority(0.42);
-
   while (1) {
     trx->driveReceiveFIFO(num);
     pthread_testcancel();
@@ -1139,8 +1137,6 @@
 {
   set_selfthread_name("RxLower");
 
-  transceiver->setPriority(0.45);
-
   while (1) {
     transceiver->driveReceiveRadio();
     pthread_testcancel();
@@ -1152,8 +1148,6 @@
 {
   set_selfthread_name("TxLower");
 
-  transceiver->setPriority(0.44);
-
   while (1) {
     transceiver->driveTxFIFO();
     pthread_testcancel();
@@ -1190,8 +1184,6 @@
   snprintf(thread_name, 16, "TxUpper%zu", num);
   set_selfthread_name(thread_name);
 
-  trx->setPriority(0.40);
-
   while (1) {
     trx->driveTxPriorityQueue(num);
     pthread_testcancel();
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 18dc5f2..1a4d28f 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -247,9 +247,6 @@
 
   void reset();
 
-  /** set priority on current thread */
-  void setPriority(float prio = 0.5) { mRadioInterface->setPriority(prio); }
-
   void logRxBurst(size_t chan, const struct trx_ul_burst_ind *bi);
 };
 
diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h
index cd378a8..e637611 100644
--- a/Transceiver52M/device/common/radioDevice.h
+++ b/Transceiver52M/device/common/radioDevice.h
@@ -70,9 +70,6 @@
   /** Get the Tx window type */
   virtual enum TxWindowType getWindowType()=0;
 
-  /** Enable thread priority */
-  virtual void setPriority(float prio = 0.5) = 0;
-
   /**
 	Read samples from the radio.
 	@param buf preallocated buf to contain read result
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index bc79f97..47bac94 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -85,10 +85,6 @@
 	/** Stop the LMS */
 	bool stop();
 
-	/** Set priority not supported */
-	void setPriority(float prio = 0.5) {
-	}
-
 	enum TxWindowType getWindowType() {
 		return TX_WINDOW_LMS1;
 	}
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index 8bb94d6..5b38df4 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -125,7 +125,6 @@
 void *async_event_loop(uhd_device *dev)
 {
 	set_selfthread_name("UHDAsyncEvent");
-	dev->setPriority(0.43);
 
 	while (1) {
 		dev->recv_async_msg();
@@ -643,12 +642,6 @@
 	return true;
 }
 
-void uhd_device::setPriority(float prio)
-{
-	uhd::set_thread_priority_safe(prio);
-	return;
-}
-
 int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
 {
 	if (!num_smpls) {
diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h
index d5a6348..944578a 100644
--- a/Transceiver52M/device/uhd/UHDDevice.h
+++ b/Transceiver52M/device/uhd/UHDDevice.h
@@ -71,7 +71,6 @@
 	bool start();
 	bool stop();
 	bool restart();
-	void setPriority(float prio);
 	enum TxWindowType getWindowType() { return tx_window; }
 
 	int readSamples(std::vector<short *> &bufs, int len, bool *overrun,
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h
index 9a2426c..4123c7d 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -107,9 +107,6 @@
   /** Stop the USRP */
   bool stop();
 
-  /** Set priority not supported */
-  void setPriority(float prio = 0.5) { }
-
   enum TxWindowType getWindowType() { return TX_WINDOW_USRP1; }
 
   /**
diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h
index f19a8dc..dcfb67f 100644
--- a/Transceiver52M/radioInterface.h
+++ b/Transceiver52M/radioInterface.h
@@ -127,9 +127,6 @@
   /** returns the full-scale receive amplitude **/
   double fullScaleOutputValue();
 
-  /** set thread priority on current thread */
-  void setPriority(float prio = 0.5) { mRadio->setPriority(prio); }
-
   /** get transport window type of attached device */
   enum RadioDevice::TxWindowType getWindowType() { return mRadio->getWindowType(); }
 

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I3a88946dd71e9aeeaac9d19d396e2236c302b608
Gerrit-Change-Number: 15258
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190823/3ea4379e/attachment.html>


More information about the gerrit-log mailing list