From e378a45db0345287bbd84ff57c107b8401a18930 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 1 Jul 2020 17:30:34 +0200 Subject: [PATCH] Reorganized priorities to avoid GW starve the CPU --- srsenb/hdr/phy/phy.h | 2 +- srsenb/hdr/stack/enb_stack_lte.h | 2 +- srsenb/hdr/stack/gnb_stack_nr.h | 2 +- srsue/hdr/stack/mac/mac.h | 3 --- srsue/hdr/stack/ue_stack_lte.h | 2 +- srsue/hdr/stack/ue_stack_nr.h | 2 +- srsue/hdr/stack/upper/gw.h | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/srsenb/hdr/phy/phy.h b/srsenb/hdr/phy/phy.h index 02542d80a..598a75f0e 100644 --- a/srsenb/hdr/phy/phy.h +++ b/srsenb/hdr/phy/phy.h @@ -78,7 +78,7 @@ private: const static int MAX_WORKERS = 4; - const static int PRACH_WORKER_THREAD_PRIO = 3; + const static int PRACH_WORKER_THREAD_PRIO = 5; const static int SF_RECV_THREAD_PRIO = 1; const static int WORKERS_THREAD_PRIO = 2; diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index e0674aaef..ce97bf1d2 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -118,7 +118,7 @@ public: void defer_task(srslte::move_task_t task) final; private: - static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD + static const int STACK_MAIN_THREAD_PRIO = 4; // thread loop void run_thread() override; void stop_impl(); diff --git a/srsenb/hdr/stack/gnb_stack_nr.h b/srsenb/hdr/stack/gnb_stack_nr.h index 913bda089..b920b544f 100644 --- a/srsenb/hdr/stack/gnb_stack_nr.h +++ b/srsenb/hdr/stack/gnb_stack_nr.h @@ -114,7 +114,7 @@ private: uint32_t current_tti = 10240; // Thread - static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD + static const int STACK_MAIN_THREAD_PRIO = 4; srslte::task_multiqueue pending_tasks; std::vector deferred_stack_tasks; ///< enqueues stack tasks from within. Avoids locking srslte::task_thread_pool background_tasks; ///< Thread pool used for long, low-priority tasks diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index 4f6c8cc28..defffa0ff 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -115,9 +115,6 @@ private: bool is_in_window(uint32_t tti, int* start, int* len); - static const int MAC_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD - static const int MAC_PDU_THREAD_PRIO = 5; - // Interaction with PHY phy_interface_mac_lte* phy_h = nullptr; rlc_interface_mac* rlc_h = nullptr; diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index d98b287d4..25286ef3e 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -165,7 +165,7 @@ private: gw_interface_stack* gw = nullptr; // Thread - static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD + static const int STACK_MAIN_THREAD_PRIO = 4; srslte::task_multiqueue pending_tasks; int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1, stack_queue_id = -1, background_queue_id = -1; srslte::task_thread_pool background_tasks; ///< Thread pool used for long, low-priority tasks diff --git a/srsue/hdr/stack/ue_stack_nr.h b/srsue/hdr/stack/ue_stack_nr.h index 3c791e0db..aa9507eaf 100644 --- a/srsue/hdr/stack/ue_stack_nr.h +++ b/srsue/hdr/stack/ue_stack_nr.h @@ -134,7 +134,7 @@ private: gw_interface_stack* gw = nullptr; // Thread - static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD + static const int STACK_MAIN_THREAD_PRIO = 4; srslte::task_multiqueue pending_tasks; int sync_queue_id = -1, ue_queue_id = -1, gw_queue_id = -1, mac_queue_id = -1, background_queue_id = -1; diff --git a/srsue/hdr/stack/upper/gw.h b/srsue/hdr/stack/upper/gw.h index eb3e89760..4db1f2a1f 100644 --- a/srsue/hdr/stack/upper/gw.h +++ b/srsue/hdr/stack/upper/gw.h @@ -69,7 +69,7 @@ public: void add_mch_port(uint32_t lcid, uint32_t port); private: - static const int GW_THREAD_PRIO = 7; + static const int GW_THREAD_PRIO = -1; stack_interface_gw* stack = nullptr; srslte::byte_buffer_pool* pool = nullptr;