From 67aa91b2c0e7a06873e0c42f3e7088c6ce56d178 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 21 Aug 2019 13:00:38 +0200 Subject: [PATCH] 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 --- Transceiver52M/Transceiver.cpp | 8 -------- Transceiver52M/Transceiver.h | 3 --- Transceiver52M/device/common/radioDevice.h | 3 --- Transceiver52M/device/lms/LMSDevice.h | 4 ---- Transceiver52M/device/uhd/UHDDevice.cpp | 7 ------- Transceiver52M/device/uhd/UHDDevice.h | 1 - Transceiver52M/device/usrp1/USRPDevice.h | 3 --- Transceiver52M/radioInterface.h | 3 --- 8 files changed, 32 deletions(-) diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 4da18762..2d5c04ea 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -1126,8 +1126,6 @@ void *RxUpperLoopAdapter(TrxChanThParams *params) 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 @@ void *RxLowerLoopAdapter(Transceiver *transceiver) { set_selfthread_name("RxLower"); - transceiver->setPriority(0.45); - while (1) { transceiver->driveReceiveRadio(); pthread_testcancel(); @@ -1152,8 +1148,6 @@ void *TxLowerLoopAdapter(Transceiver *transceiver) { set_selfthread_name("TxLower"); - transceiver->setPriority(0.44); - while (1) { transceiver->driveTxFIFO(); pthread_testcancel(); @@ -1190,8 +1184,6 @@ void *TxUpperLoopAdapter(TrxChanThParams *params) 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 18dc5f2e..1a4d28fd 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -247,9 +247,6 @@ protected: 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 cd378a8f..e6376116 100644 --- a/Transceiver52M/device/common/radioDevice.h +++ b/Transceiver52M/device/common/radioDevice.h @@ -70,9 +70,6 @@ class RadioDevice { /** 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 bc79f973..47bac945 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -85,10 +85,6 @@ public: /** 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 8bb94d63..5b38df46 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -125,7 +125,6 @@ static const std::map dev_param_map { 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 @@ bool uhd_device::stop() 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 d5a63484..944578a0 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -71,7 +71,6 @@ public: bool start(); bool stop(); bool restart(); - void setPriority(float prio); enum TxWindowType getWindowType() { return tx_window; } int readSamples(std::vector &bufs, int len, bool *overrun, diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h index 9a2426cb..4123c7d7 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.h +++ b/Transceiver52M/device/usrp1/USRPDevice.h @@ -107,9 +107,6 @@ private: /** 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 f19a8dc4..dcfb67f2 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -127,9 +127,6 @@ public: /** 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(); }