From 86b1b5772539ce79d21fdc6c58bb11f6e50cbf6a Mon Sep 17 00:00:00 2001 From: dufuhang Date: Fri, 20 Sep 2024 14:14:32 +0800 Subject: [PATCH] Clear plugin repository when stopping tuning Not clearing it before a profile switch would result in never deleting the original plugin objects - those would accumulate in memory with each profile switch. TBH, I believe we could get rid of the plugin repository class altogether, I'm not quite sure what's its responsibility and why we need it when we have the plugin manager. --- ...ugin-repository-when-stopping-tuning.patch | 25 +++++++++++++++++++ tuned.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 clear-plugin-repository-when-stopping-tuning.patch diff --git a/clear-plugin-repository-when-stopping-tuning.patch b/clear-plugin-repository-when-stopping-tuning.patch new file mode 100644 index 0000000..418c01e --- /dev/null +++ b/clear-plugin-repository-when-stopping-tuning.patch @@ -0,0 +1,25 @@ +From 514f5209dc9bb2f6bea84ebbd1efe22d67e0fbd2 Mon Sep 17 00:00:00 2001 +From: pavol +Date: Fri, 20 Sep 2024 14:53:28 +0800 +Subject: [PATCH] clear plugin repository when stopping tuning + +--- + tuned/units/manager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tuned/units/manager.py b/tuned/units/manager.py +index 0ae5d9e..b00e0f2 100644 +--- a/tuned/units/manager.py ++++ b/tuned/units/manager.py +@@ -133,7 +133,7 @@ class Manager(object): + for plugin in self._plugins: + log.debug("cleaning plugin '%s'" % plugin.name) + self._try_call("destroy_all", None, plugin.cleanup) +- ++ self._plugins_repository.plugins.clear() + del self._plugins[:] + del self._instances[:] + +-- +2.43.0 + diff --git a/tuned.spec b/tuned.spec index e981eef..8e8bf40 100644 --- a/tuned.spec +++ b/tuned.spec @@ -1,7 +1,7 @@ Summary: A system tuning service for Linux Name: tuned Version: 2.20.0 -Release: 4 +Release: 5 License: GPLv2+ Source0: https://github.com/redhat-performance/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz URL: http://www.tuned-project.org/ @@ -38,6 +38,7 @@ Patch4: tuned-add-app-sensor-profile.patch Patch5: profiles-drop-sched_-tuning-where-appropriate.patch Patch6: bugfix-check_positive-has-some-contradictions.patch Patch7: bugfix-expand-variables-in-Plugin.patch +Patch8: clear-plugin-repository-when-stopping-tuning.patch Provides: tuned-gtk = %{version}-%{release} Provides: tuned-utils = %{version}-%{release} @@ -297,6 +298,9 @@ fi %{_mandir}/man7/tuned-profiles-spectrumscale-ece.7* %changelog +* Fri Sep 20 2024 dufuhang - 2.20.0-5 +- Clear plugin repository when stopping tuning + * Fri Sep 20 2024 dufuhang - 2.20.0-4 - bugfix: expand variables in Plugin._verify_all_device_commands -- Gitee