Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Private Attributes | List of all members
RtSchedulingPlugin Class Reference

Dobby RtScheduling plugin. More...

#include <RtSchedulingPlugin.h>

Inheritance diagram for RtSchedulingPlugin:
Inheritance graph
[legend]
Collaboration diagram for RtSchedulingPlugin:
Collaboration graph
[legend]

Public Member Functions

 RtSchedulingPlugin (std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath)
 
std::string name () const override
 Should return the name of the plugin. More...
 
unsigned hookHints () const override
 Should return a bitfield of the hook points implemented by the plugin. More...
 
bool postInstallation () override
 Adds the default value to RLIMIT_RTPRIO in the OCI config file. More...
 
bool createRuntime () override
 Sets the RT scheduling priority on the container's init process. More...
 
std::vector< std::string > getDependencies () const override
 Should return the names of the plugins this plugin depends on. More...
 
- Public Member Functions inherited from RdkPluginBase
virtual bool preCreation ()
 
virtual bool createContainer ()
 
virtual bool postStart ()
 
virtual bool postHalt ()
 
virtual bool postStop ()
 

Private Attributes

const std::string mName
 
const std::shared_ptr< DobbyRdkPluginUtilsmUtils
 
std::shared_ptr< rt_dobby_schema > mConfig
 
const std::string mRootfsPath
 

Additional Inherited Members

- Public Types inherited from IDobbyRdkPlugin
enum  HintFlags : unsigned {
  PostInstallationFlag = (1 << 0) , PreCreationFlag = (1 << 1) , CreateRuntimeFlag = (1 << 2) , CreateContainerFlag = (1 << 3) ,
  PostStartFlag = (1 << 5) , PostHaltFlag = (1 << 6) , PostStopFlag = (1 << 7) , Unknown = 0
}
 Bit flags that should be returned by hookHints. More...
 

Detailed Description

Dobby RtScheduling plugin.

This plugin sets the RT priority of the container.

This consists of a postInstallation hook that adds the rtpriority limit and createRuntime hook that calls sched_setscheduler on the container's init process.

Due to the way scheduling is inherited this will in turn filter down to all processes running within the container.

Member Function Documentation

◆ createRuntime()

bool RtSchedulingPlugin::createRuntime ( )
overridevirtual

Sets the RT scheduling priority on the container's init process.

This simply calls sched_setscheduler on the supplied pid, inserting the given default rt priority value.

Returns
true if successiful otherwise false.

Reimplemented from RdkPluginBase.

◆ getDependencies()

std::vector< std::string > RtSchedulingPlugin::getDependencies ( ) const
overridevirtual

Should return the names of the plugins this plugin depends on.

This can be used to determine the order in which the plugins should be processed when running hooks.

Returns
Names of the plugins this plugin depends on.

Reimplemented from RdkPluginBase.

◆ hookHints()

unsigned RtSchedulingPlugin::hookHints ( ) const
overridevirtual

Should return a bitfield of the hook points implemented by the plugin.

Only bits that are set will be called as hooks. This is to optimise the implementation of the hook code to ensure we don't waste time trying to run hooks that don't do anything

The value returned should be constant for the lifetime of the class

Returns
bitmask of the HintFlags bits.

Implements IDobbyRdkPlugin.

◆ name()

std::string RtSchedulingPlugin::name ( ) const
inlineoverridevirtual

Should return the name of the plugin.

Returns
string with the name of the hook.

Implements IDobbyRdkPlugin.

◆ postInstallation()

bool RtSchedulingPlugin::postInstallation ( )
overridevirtual

Adds the default value to RLIMIT_RTPRIO in the OCI config file.

This hook creates the RLIMIT_RTPRIO field if it doesn't exist.

Returns
true on success, false on failure.

Reimplemented from RdkPluginBase.


The documentation for this class was generated from the following files: