#scheduler #dbus #loader #command-line-arguments #system #interface #sched-ext

app scx_loader

DBUS on-demand loader of sched-ext schedulers

1 stable release

1.0.4 Sep 7, 2024

#227 in Concurrency

Download history 107/week @ 2024-09-01 46/week @ 2024-09-08

153 downloads per month

GPL-2.0-only

23KB
324 lines

scx_loader: A DBUS Interface for Managing sched-ext Schedulers

scx_loader is a utility that provides a convenient DBUS interface for starting, stopping, and managing sched_ext schedulers.

Features

  • StartScheduler Method: Launches a scheduler specified by its scx_name (e.g., "scx_rusty") and a scheduler mode (profile) represented as an unsigned integer.
  • StartSchedulerWithArgs Method: Starts a scheduler with its scx_name and allows passing arbitrary CLI arguments directly to the scheduler.
  • StopScheduler Method: Terminates the currently running scheduler.
  • CurrentScheduler Property: Returns the scx_name of the active scheduler or "unknown" if none is running.
  • SchedulerMode Property: Provides information about the currently active scheduler's mode (profile).
  • SupportedSchedulers Property: Lists the schedulers currently supported by scx_loader.

Usage

scx_loader interacts with schedulers through its DBUS interface. You can use tools like dbus-send or gdbus to communicate with it.

Examples using dbus-send:

  • Start a Scheduler:

    dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartScheduler string:scx_rusty uint32:0
    

    (This starts scx_rusty with scheduler mode 0)

  • Start a Scheduler with Arguments:

    dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartSchedulerWithArgs string:scx_bpfland array:string:"-k","-c","0"
    

    (This starts scx_bpfland with arguments -k -c 0)

  • Stop the Current Scheduler:

    dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StopScheduler
    
  • Get the Currently Active Scheduler:

    dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:CurrentScheduler
    
  • Get the Supported Schedulers:

    dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:SupportedSchedulers
    

Note: Replace the example scheduler names and arguments with the actual ones you want to use.

Development Status

scx_loader is under active development. Future improvements may include:

  • More robust error handling.
  • Configuration file.

Dependencies

~11–23MB
~340K SLoC