Skip to contentSkip to conversation

Remove "Save kthread tunings" and obsolete rtctl elements.

PATCH New John B. Wyatt IV 1 participant 1 message Sep 12, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove "Save kthread tunings" and obsolete rtctl elements.

Tuna offered a way to export kthread tunable settings for a program called rtctl that is no longer packaged in modern Linux distros. Removing this functionality involved the removal of the tuna save command, a (right) menu click option for the process list in the first tab of the Tuna gui, and the removal of the 'Save Snapshot' button from the second tab of the Tuna gui. The remaining changes involve translations with the removed elements.

Removing functionality that is not tested or used simplifies the code base and makes Tuna more maintainable. tuna save especially caused confusion with tuna apply as apply is intended for Tuna style configuration files and shares nothing in common with tuna save.

I deleted instead of reusing tuna save to save Tuna style configuration files to match tuna apply as it is an open question with my previous email if the tuna profile functionality is used.

References to rtctl were not removed from testuna. That file uses an older version of Tuna's commands and will not function with modern Tuna. The rtctl references help to understand what the file was intending to do and should be part of a separate cleanup or delete the file.

---
 docs/tuna.8            | 21 ----------
 po/ja.po               |  9 -----
 po/pt_BR.po            |  9 -----
 po/zh_CN.po            | 10 -----
 tuna-cmd.py            | 23 -----------
 tuna/config.py         | 50 -----------------------
 tuna/gui/commonview.py |  8 ----
 tuna/gui/procview.py   | 66 ------------------------------
 tuna/tuna.py           | 92 ------------------------------------------
 tuna/tuna_gui.glade    | 55 -------------------------
 tuna/tuna_gui.py       |  2 -
 11 files changed, 345 deletions(-)
docs/tuna.8 +0 -21
index 6e30537..3adb598 100644
@@ -148,27 +148,6 @@ optional arguments:
   -b, --background      Run command as background task
 
 .TP
-\fBtuna save\fR
-usage: tuna-cmd.py save [-h] [-c CPU-LIST | -S CPU-SOCKET-LIST | -N]
-                        [-t THREAD-LIST]
-                        FILENAME
-
-Save kthreads sched tunables to FILENAME
-
-positional arguments:
-  FILENAME              Save kthreads sched tunables to this file
-
-optional arguments:
-  -h, --help            show this help message and exit
-  -c CPU-LIST, --cpus CPU-LIST
-                        CPU-LIST affected by commands
-  -S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
-                        CPU-SOCKET-LIST affected by commands
-  -N, --nohz_full       CPUs in nohz_full kernel command line will be affected
-                        by operations
-  -t THREAD-LIST, --threads THREAD-LIST
-                        THREAD-LIST affected by commands
-.TP
 \fBtuna apply\fR
 usage: tuna-cmd.py apply [-h] profilename
 
po/ja.po +0 -9
index 65006b1..9940d13 100644
@@ -540,10 +540,6 @@ msgstr "ユーザースレッドを表示(_S)"
 msgid "_What is this?"
 msgstr "これは何?(_W)"
 
-#: tuna/gui/procview.py:559
-msgid "_Save kthreads tunings"
-msgstr "カーネルスレッド設定を保存(_S)"
-
 #: tuna/gui/irqview.py:117 tuna/gui/irqview.py:139
 msgid "IRQ"
 msgstr "IRQ"
@@ -651,11 +647,6 @@ msgstr "%(irqlist)s をコマンドの対象とする"
 msgid "FILENAME"
 msgstr "FILENAME"
 
-#: tuna-cmd.py:67
-#, python-format
-msgid "Save kthreads sched tunables to %(filename)s"
-msgstr "カーネルスレッドのスケジューラパラメータ設定を %(filename)s に保存"
-
 #: tuna-cmd.py:70 tuna-cmd.py:71
 msgid "CPU-SOCKET-LIST"
 msgstr "CPU-SOCKET-LIST"
po/pt_BR.po +0 -9
index c702ff9..3bcf1d4 100644
@@ -442,10 +442,6 @@ msgstr "_Mostrar threads"
 msgid "_What is this?"
 msgstr "_O que é isto?"
 
-#: tuna/gui/procview.py:559
-msgid "_Save kthreads tunings"
-msgstr "_Salvar"
-
 #: tuna/gui/irqview.py:119 tuna/gui/irqview.py:141
 msgid "IRQ"
 msgstr ""
@@ -558,11 +554,6 @@ msgstr "%(irqlist)s afetada por comandos"
 msgid "FILENAME"
 msgstr "ARQUIVO"
 
-#: tuna-cmd.py:68
-#, python-format
-msgid "Save kthreads sched tunables to %(filename)s"
-msgstr "Salva opções configuráveis das threads do kernel em %(filename)s"
-
 #: tuna-cmd.py:71 tuna-cmd.py:72
 msgid "CPU-SOCKET-LIST"
 msgstr "LISTA-DE-SOCKETS-DE-CPUS"
po/zh_CN.po +0 -10
index c76e22e..9086545 100644
@@ -488,11 +488,6 @@ msgstr "显示用户线程(_S)"
 msgid "_What is this?"
 msgstr "这是什么?(_W)"
 
-#: tuna/gui/procview.py:559
-#, fuzzy
-msgid "_Save kthreads tunings"
-msgstr "保存内核调整(_S)"
-
 #: tuna/gui/irqview.py:119 tuna/gui/irqview.py:141
 msgid "IRQ"
 msgstr "中断"
@@ -600,11 +595,6 @@ msgstr "命令影响 %(irqlist)s"
 msgid "FILENAME"
 msgstr "文件名"
 
-#: tuna-cmd.py:67
-#, python-format
-msgid "Save kthreads sched tunables to %(filename)s"
-msgstr "保存内核线程调度参数到 %(filename)s"
-
 #: tuna-cmd.py:70 tuna-cmd.py:71
 msgid "CPU-SOCKET-LIST"
 msgstr "CPU套接字列表"
tuna-cmd.py +0 -23
index d0a3e6b..a445470 100755
@@ -93,7 +93,6 @@ def gen_parser():
     POS = {
             "cpu_list": dict(metavar='CPU-LIST', type=tuna.cpustring_to_list, help="CPU-LIST affected by commands"),
             "thread_list": dict(metavar='THREAD-LIST', type=threadstring_to_list, help="THREAD-LIST affected by commands"),
-            "filename": dict(metavar='FILENAME', type=str, help="Save kthreads sched tunables to this file"),
             "profilename": dict(type=str, help="Apply changes described in this file"),
             "run_command": dict(metavar='COMMAND', type=str, help="fork a new process and run the \"COMMAND\""),
             "priority": dict(type=tuna.get_policy_and_rtprio, metavar="POLICY:RTPRIO", help="Set thread scheduler tunables: POLICY and RTPRIO"),
@@ -148,8 +147,6 @@ def gen_parser():
                                     help="Set thread scheduler tunables: POLICY and RTPRIO")
     run = subparser.add_parser('run', description="Fork a new process and run the COMMAND",
                                 help="Fork a new process and run the COMMAND")
-    save = subparser.add_parser('save', description="Save kthreads sched tunables to FILENAME",
-                                help="Save kthreads sched tunables to FILENAME")
     apply = subparser.add_parser('apply', description="Apply changes described in profile",
                                 help="Apply changes described in profile")
     show_threads = subparser.add_parser('show_threads', description='Show thread list', help='Show thread list')
@@ -196,13 +193,6 @@ def gen_parser():
     run.add_argument('-p', '--priority', **MODS['priority'])
     run.add_argument('-b', '--background', **MODS['background'])
 
-    save.add_argument('filename', **POS['filename'])
-    save_group = save.add_mutually_exclusive_group(required=False)
-    save_group.add_argument('-c', '--cpus', **MODS['cpus'])
-    save_group.add_argument('-S', '--sockets', **MODS['sockets'])
-    save_group.add_argument('-N', '--nohz_full', **MODS['nohz_full'])
-    save.add_argument('-t', '--threads', **MODS['threads'])
-
     apply.add_argument('profilename', **POS['profilename'])
 
     show_threads_group1 = show_threads.add_mutually_exclusive_group(required=False)
@@ -267,16 +257,6 @@ def thread_help(tid):
     print(help)
 
 
-def save(cpu_list, thread_list, filename):
-    kthreads = tuna.get_kthread_sched_tunings()
-    for name in list(kthreads.keys()):
-        kt = kthreads[name]
-        if (cpu_list and not set(kt.affinity).intersection(set(cpu_list))) or \
-           (thread_list and kt.pid not in thread_list):
-            del kthreads[name]
-    tuna.generate_rtgroups(filename, kthreads, utils.get_nr_cpus())
-
-
 def ps_show_header(has_ctxt_switch_info, cgroups=False):
     print("%7s %6s %5s %7s       %s" %
           (" ", " ", " ", _("thread"),
@@ -753,9 +733,6 @@ def main():
         if args.irq_list:
             tuna.move_irqs_to_cpu(args.cpu_list, args.irq_list, spread=spread)
 
-    elif args.command in ['s', 'save']:
-        save(args.cpu_list, args.thread_list, args.filename)
-
     elif args.command in ['W', 'what_is']:
         for tid in args.thread_list:
             thread_help(tid)
tuna/config.py +0 -50

56 lines not on this page · raw message

tuna/gui/commonview.py +0 -8
index 8089ed1..297fdb8 100644
@@ -164,14 +164,6 @@ class commonview:
             ret = dialog.run()
             dialog.destroy()
 
-    def on_saveSnapshot_clicked(self, widget):
-        ret = self.guiSnapshot()
-        self.config.saveSnapshot(self.ret)
-        old_name = self.get_current_combo_selection()
-        if self.profileview.setProfileFileList():
-            self.profileview.set_current_tree_selection(old_name[1])
-            self.set_current_combo_selection(old_name[1])
-
     def on_saveTunedChanges_clicked(self, widget):
         if not self.config.checkTunedDaemon():
             dialog = Gtk.MessageDialog(None, \
tuna/gui/procview.py +0 -66

90 lines not on this page · raw message

tuna/tuna.py +0 -92

103 lines not on this page · raw message

tuna/tuna_gui.glade +0 -55

61 lines not on this page · raw message

tuna/tuna_gui.py +0 -2
index cefee4a..2041568 100755
@@ -92,8 +92,6 @@ class main_gui:
             : self.commonview.on_applyChanges_clicked,
             "on_undoChanges_clicked"
             : self.commonview.on_undoChanges_clicked,
-            "on_saveSnapshot_clicked"
-            : self.commonview.on_saveSnapshot_clicked,
             "on_saveTunedChanges_clicked"
             : self.commonview.on_saveTunedChanges_clicked,
             "on_profileSelector_changed"
Signature · 1 line
2.51.0