Persistence of dynamic tuning changes#758
Open
adriaan42 wants to merge 2 commits intoredhat-performance:masterfrom
Open
Persistence of dynamic tuning changes#758adriaan42 wants to merge 2 commits intoredhat-performance:masterfrom
adriaan42 wants to merge 2 commits intoredhat-performance:masterfrom
Conversation
Move the calculation if the active state of an instance from _add_devices_nocheck() to _add_devices_process(), to make it symmetric with device removal. Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
9131940 to
d6c2b69
Compare
Currently, any changes made to the tuning via the `instance_*` dbus calls
are lost when tuning is stopped by the service, or when the TuneD service
itself is stopped/restarted, or when the service crashes.
This commit:
* implements a sync of Plugin Instances and Profile Units that is currently missing.
This way, dynamic instances and device assignments are persistent across stop/start
dbus calls to TuneD.
* calculates a hash of the current profile after loading it from disk
(after processing all includes, so we have a "flat" representation)
* creates snapshots of the current profile whenever instances or assigned
devices change. the snapshot includes the hash of the profile as
it was initially loaded. for each instance it stores the devices that
are currently attached.
* restores a snapshot found at startup, if the hashes match (i.e. there
have been no profile switches and no changes to the profile or any of
its includes on disk)
snapshots are restored in case of
- daemon restarts (systemctl restart/stop/start)
- daemon crashes
snapshots are NOT restored in case of
- reboots (snapshots are stored in /var/run)
- profile changes (snapshots are explicitly deleted when switching profiles,
even when "switching" to the same/current profile)
Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
d6c2b69 to
f0bdfb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, any changes made to the tuning via the
instance_*dbus calls are lost when tuning is stopped by the service, or when the TuneD service itself is stopped/restarted, or when the service crashes.This PR:
implements a sync of Plugin Instances and Profile Units that is currently missing. This way, dynamic instances and device assignments are persistent across stop/start dbus calls to TuneD.
calculates a hash of the current profile after loading it from disk (after processing all includes, so we have a "flat" representation)
creates snapshots of the current profile whenever instances or assigned devices change. the snapshot includes the hash of the profile as it was initially loaded. for each instance it stores the devices that are currently attached.
restores a snapshot found at startup, if the hashes match (i.e. there have been no profile switches and no changes to the profile or any of its includes on disk)
snapshots are restored in case of
snapshots are NOT restored in case of
even when "switching" to the same/current profile)