Skip to content

Commit 4d829c6

Browse files
committed
exec: make the number of pre-reserved producers max by default
1 parent adeebb9 commit 4d829c6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

apps/services/worker_manager/worker_manager.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ worker_manager::create_du_crit_path_prio_executors(const worker_manager_config::
462462
const std::string l1_high_prio_name = l1_pdsch_exec_name;
463463
const auto dl_worker_pool_prio = os_thread_realtime_priority::max() - 2;
464464
const std::chrono::microseconds dl_worker_sleep_time{50};
465-
const unsigned qsize = task_worker_queue_size;
465+
const unsigned qsize = task_worker_queue_size;
466+
const unsigned prereserved_l2_producers = 2;
466467

467468
std::vector<os_sched_affinity_bitmask> dl_cpu_masks;
468469
for (unsigned w = 0; w != nof_dl_workers; ++w) {
@@ -472,14 +473,15 @@ worker_manager::create_du_crit_path_prio_executors(const worker_manager_config::
472473
// Instantiate dedicated worker pool for high priority tasks such as L2, the upper physical layer downlink
473474
// processing, and the PRACH detector. This worker pool comprises four different priority queues where the L2 and
474475
// the PRACH detector queues have the highest priority.
475-
const worker_pool dl_worker_pool{name_dl,
476-
nof_dl_workers,
477-
{{l2_exec_name, concurrent_queue_policy::moodycamel_lockfree_mpmc, qsize},
478-
{l1_dl_exec_name, concurrent_queue_policy::lockfree_mpmc, qsize},
479-
{l1_pdsch_exec_name, concurrent_queue_policy::lockfree_mpmc, qsize}},
480-
dl_worker_sleep_time,
481-
dl_worker_pool_prio,
482-
dl_cpu_masks};
476+
const worker_pool dl_worker_pool{
477+
name_dl,
478+
nof_dl_workers,
479+
{{l2_exec_name, concurrent_queue_policy::moodycamel_lockfree_mpmc, qsize, prereserved_l2_producers},
480+
{l1_dl_exec_name, concurrent_queue_policy::lockfree_mpmc, qsize},
481+
{l1_pdsch_exec_name, concurrent_queue_policy::lockfree_mpmc, qsize}},
482+
dl_worker_sleep_time,
483+
dl_worker_pool_prio,
484+
dl_cpu_masks};
483485

484486
if (not exec_mng.add_execution_context(create_execution_context(dl_worker_pool))) {
485487
report_fatal_error("Failed to instantiate {} execution context", dl_worker_pool.name);

include/srsran/support/executors/task_execution_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct task_queue {
3434
/// Size of the queue used.
3535
unsigned size;
3636
/// Number of pre-reserved producers in the case of the moodycamel lockfree MPMC queue.
37-
unsigned nof_prereserved_producers = 2;
37+
unsigned nof_prereserved_producers = std::thread::hardware_concurrency();
3838
};
3939

4040
/// Arguments for a single task worker creation.

0 commit comments

Comments
 (0)