Skip to content

Commit

Permalink
Revert "WorkerSettings: Add disableLiburing option"
Browse files Browse the repository at this point in the history
This reverts commit 0799e37.
  • Loading branch information
ibc committed Aug 12, 2024
1 parent 62f0bf4 commit a69a070
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
10 changes: 0 additions & 10 deletions node/src/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ export type WorkerSettings<WorkerAppData extends AppData = AppData> = {
*/
libwebrtcFieldTrials?: string;

/**
* Disable liburing (io_uring) despite it's supported in current host.
*/
disableLiburing?: boolean;

/**
* Custom application data.
*/
Expand Down Expand Up @@ -292,7 +287,6 @@ export class Worker<
dtlsCertificateFile,
dtlsPrivateKeyFile,
libwebrtcFieldTrials,
disableLiburing,
appData,
}: WorkerSettings<WorkerAppData>) {
super();
Expand Down Expand Up @@ -344,10 +338,6 @@ export class Worker<
spawnArgs.push(`--libwebrtcFieldTrials=${libwebrtcFieldTrials}`);
}

if (disableLiburing) {
spawnArgs.push(`--disableLiburing`);
}

logger.debug(
'spawning worker process: %s %s',
spawnBin,
Expand Down
10 changes: 0 additions & 10 deletions rust/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ pub struct WorkerSettings {
/// "WebRTC-Bwe-AlrLimitedBackoff/Enabled/".
#[doc(hidden)]
pub libwebrtc_field_trials: Option<String>,
/// Disable liburing (io_uring) despite it's supported in current host.
pub disable_liburing: Option<bool>,
/// 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<Arc<dyn Fn() + Send + Sync>>,
Expand Down Expand Up @@ -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(),
}
Expand All @@ -238,7 +235,6 @@ impl fmt::Debug for WorkerSettings {
rtc_port_range,
dtls_files,
libwebrtc_field_trials,
disable_liburing,
thread_initializer,
app_data,
} = self;
Expand All @@ -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"),
Expand Down Expand Up @@ -361,7 +356,6 @@ impl Inner {
rtc_port_range,
dtls_files,
libwebrtc_field_trials,
disable_liburing,
thread_initializer,
app_data,
}: WorkerSettings,
Expand Down Expand Up @@ -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:{}]: {}",
Expand Down
1 change: 0 additions & 1 deletion worker/include/Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Settings
std::string dtlsCertificateFile;
std::string dtlsPrivateKeyFile;
std::string libwebrtcFieldTrials{ "WebRTC-Bwe-AlrLimitedBackoff/Enabled/" };
bool liburingDisabled{ false };
};

public:
Expand Down
12 changes: 2 additions & 10 deletions worker/src/DepLibUring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#include "DepLibUring.hpp"
#include "Logger.hpp"
#include "MediaSoupErrors.hpp"
#include "Settings.hpp"
#include "Utils.hpp"
#include <sys/eventfd.h>
#include <sys/resource.h>
#include <sys/utsname.h>

/* 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. */
Expand Down Expand Up @@ -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();

Expand Down
16 changes: 6 additions & 10 deletions worker/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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':
Expand Down Expand Up @@ -155,13 +158,6 @@ void Settings::SetConfiguration(int argc, char* argv[])
break;
}

case 'd':
{
Settings::configuration.liburingDisabled = true;

break;
}

// Invalid option.
case '?':
{
Expand Down

0 comments on commit a69a070

Please sign in to comment.