From a69a070e224deda88753eec6ba3360e853fda161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Mon, 12 Aug 2024 11:19:46 +0200 Subject: [PATCH] Revert "WorkerSettings: Add disableLiburing option" This reverts commit 0799e371441d5d81457d42bc33a88bd073bf62fa. --- node/src/Worker.ts | 10 ---------- rust/src/worker.rs | 10 ---------- worker/include/Settings.hpp | 1 - worker/src/DepLibUring.cpp | 12 ++---------- worker/src/Settings.cpp | 16 ++++++---------- 5 files changed, 8 insertions(+), 41 deletions(-) diff --git a/node/src/Worker.ts b/node/src/Worker.ts index 2d5ab30bc2..e86206d98b 100644 --- a/node/src/Worker.ts +++ b/node/src/Worker.ts @@ -83,11 +83,6 @@ export type WorkerSettings = { */ libwebrtcFieldTrials?: string; - /** - * Disable liburing (io_uring) despite it's supported in current host. - */ - disableLiburing?: boolean; - /** * Custom application data. */ @@ -292,7 +287,6 @@ export class Worker< dtlsCertificateFile, dtlsPrivateKeyFile, libwebrtcFieldTrials, - disableLiburing, appData, }: WorkerSettings) { super(); @@ -344,10 +338,6 @@ export class Worker< spawnArgs.push(`--libwebrtcFieldTrials=${libwebrtcFieldTrials}`); } - if (disableLiburing) { - spawnArgs.push(`--disableLiburing`); - } - logger.debug( 'spawning worker process: %s %s', spawnBin, diff --git a/rust/src/worker.rs b/rust/src/worker.rs index 68a9ecbadd..60a08b67f0 100644 --- a/rust/src/worker.rs +++ b/rust/src/worker.rs @@ -192,8 +192,6 @@ pub struct WorkerSettings { /// "WebRTC-Bwe-AlrLimitedBackoff/Enabled/". #[doc(hidden)] pub libwebrtc_field_trials: Option, - /// Disable liburing (io_uring) despite it's supported in current host. - pub disable_liburing: Option, /// Function that will be called under worker thread before worker starts, can be used for /// pinning worker threads to CPU cores. pub thread_initializer: Option>, @@ -223,7 +221,6 @@ impl Default for WorkerSettings { rtc_port_range: 10000..=59999, dtls_files: None, libwebrtc_field_trials: None, - disable_liburing: None, thread_initializer: None, app_data: AppData::default(), } @@ -238,7 +235,6 @@ impl fmt::Debug for WorkerSettings { rtc_port_range, dtls_files, libwebrtc_field_trials, - disable_liburing, thread_initializer, app_data, } = self; @@ -249,7 +245,6 @@ impl fmt::Debug for WorkerSettings { .field("rtc_port_range", &rtc_port_range) .field("dtls_files", &dtls_files) .field("libwebrtc_field_trials", &libwebrtc_field_trials) - .field("disable_liburing", &disable_liburing) .field( "thread_initializer", &thread_initializer.as_ref().map(|_| "ThreadInitializer"), @@ -361,7 +356,6 @@ impl Inner { rtc_port_range, dtls_files, libwebrtc_field_trials, - disable_liburing, thread_initializer, app_data, }: WorkerSettings, @@ -410,10 +404,6 @@ impl Inner { )); } - if let Some(disable_liburing) = disable_liburing { - spawn_args.push(format!("--disable_liburing")); - } - let id = WorkerId::new(); debug!( "spawning worker with arguments [id:{}]: {}", diff --git a/worker/include/Settings.hpp b/worker/include/Settings.hpp index 1025260e3d..06a66f4bf6 100644 --- a/worker/include/Settings.hpp +++ b/worker/include/Settings.hpp @@ -39,7 +39,6 @@ class Settings std::string dtlsCertificateFile; std::string dtlsPrivateKeyFile; std::string libwebrtcFieldTrials{ "WebRTC-Bwe-AlrLimitedBackoff/Enabled/" }; - bool liburingDisabled{ false }; }; public: diff --git a/worker/src/DepLibUring.cpp b/worker/src/DepLibUring.cpp index 8ad9bc8555..c5e8aed778 100644 --- a/worker/src/DepLibUring.cpp +++ b/worker/src/DepLibUring.cpp @@ -4,7 +4,6 @@ #include "DepLibUring.hpp" #include "Logger.hpp" #include "MediaSoupErrors.hpp" -#include "Settings.hpp" #include "Utils.hpp" #include #include @@ -12,9 +11,9 @@ /* Static variables. */ bool DepLibUring::enabled{ false }; -// liburing instance per thread. +/* liburing instance per thread. */ thread_local DepLibUring::LibUring* DepLibUring::liburing{ nullptr }; -// Completion queue entry array used to retrieve processes tasks. +/* Completion queue entry array used to retrieve processes tasks. */ thread_local struct io_uring_cqe* cqes[DepLibUring::QueueDepth]; /* Static methods for UV callbacks. */ @@ -122,13 +121,6 @@ void DepLibUring::ClassInit() MS_DEBUG_TAG(info, "liburing version: \"%i.%i\"", mayor, minor); - if (Settings::configuration.liburingDisabled) - { - MS_DEBUG_TAG(info, "liburing disabled by user settings"); - - return; - } - // This must be called first. DepLibUring::CheckRuntimeSupport(); diff --git a/worker/src/Settings.cpp b/worker/src/Settings.cpp index 029083a13a..a989bc44e5 100644 --- a/worker/src/Settings.cpp +++ b/worker/src/Settings.cpp @@ -60,8 +60,7 @@ void Settings::SetConfiguration(int argc, char* argv[]) { "dtlsCertificateFile", optional_argument, nullptr, 'c' }, { "dtlsPrivateKeyFile", optional_argument, nullptr, 'p' }, { "libwebrtcFieldTrials", optional_argument, nullptr, 'W' }, - { "disableLiburing", no_argument, nullptr, 'd' }, - { nullptr, 0, nullptr, 0 } + { nullptr, 0, nullptr, 0 } }; // clang-format on std::string stringValue; @@ -74,9 +73,13 @@ void Settings::SetConfiguration(int argc, char* argv[]) optind = 1; // Set explicitly, otherwise subsequent runs will fail. opterr = 0; // Don't allow getopt to print error messages. - while ((c = getopt_long_only(argc, argv, "", options, &optionIdx)) != -1) { + if (!optarg) + { + MS_THROW_TYPE_ERROR("unknown configuration parameter: %s", optarg); + } + switch (c) { case 'l': @@ -155,13 +158,6 @@ void Settings::SetConfiguration(int argc, char* argv[]) break; } - case 'd': - { - Settings::configuration.liburingDisabled = true; - - break; - } - // Invalid option. case '?': {