tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Refactor dynamic tuning and add per-plugin global configuration

Open zacikpa opened this issue 10 months ago • 2 comments

In this PR, I add a global per-plugin configuration of dynamic tuning, which works as follows:

  1. The boolean dynamic_tuning option stays as it is - it can be used to globally enable or disable dynamic tuning in all plugins.
  2. When dynamic_tuning is on, one can use the new dynamic_plugins option to restrict the set of plugins which can perform dynamic tuning. For instance, setting dynamic_plugins=scheduler,disk enables dynamic tuning only for the two plugins.
  3. On plugin instance level, one can still disable dynamic tuning by setting dynamic=0 in the profile configuration. This now works for all plugins with dynamic capabilities.

Secondly, I integrated the "runtime" functionality of the scheduler plugin under dynamic tuning. To do so, we need to distinguish between dynamic plugins that are updated periodically by the main daemon thread (currently, all except the scheduler plugin) and dynamic plugins that implement their tuning in their own thread.

The changes required quite a bit of refactoring. I believe the code could be made even cleaner by creating a separate subclass of Plugin for the dynamic plugins, but that would require even more massive refactoring, so I'm not sure if it's worth doing at this point.

zacikpa avatar Apr 15 '24 15:04 zacikpa

Please resolve conflicts.

yarda avatar May 23 '24 19:05 yarda

Please resolve conflicts.

Done.

zacikpa avatar May 28 '24 13:05 zacikpa