Package: tuned
Version: 2.20.0-1
Severity: normal
Tags: patch upstream
X-Debbugs-Cc: yoann.con...@smile.fr

Dear Maintainer,

In grub, the system can be booted from the main menu (first screen we
see), or submenus "Advanced options for Debian GNU/Linux".

When tuned is active, grub.cfg looks like this (edited for clarity):
set tuned_params="skew_tick=1 isolcpus=managed_irq,domain, intel_pstate=disable 
nosoftlockup tsc=reliable"
[...]
menuentry 'Debian GNU/Linux' [...] {
  [...]
  linux  /vmlinuz-6.1.0-30-amd64 root=/dev/mapper/debian--vm--vg-root ro  quiet 
$tuned_params
submenu 'Advanced options for Debian GNU/Linux' [...] {
  menuentry 'Debian GNU/Linux, with Linux 6.1.0-30-amd64' [...] {
    [...]
    linux  /vmlinuz-6.1.0-30-amd64 root=/dev/mapper/debian--vm--vg-root ro  
quiet $tuned_params

$tuned_params is effectly extended when using the main menu "Debian GNU/Linux"
but not when using the submenu
"Advanced options for Debian GNU/Linux>Advanced options for Debian GNU/Linux"

This is because $tuned_params is not exported. See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094201#10

I've sent a patch upstream (now merged):
https://github.com/redhat-performance/tuned/commit/e9f0f228b3a452d6575ab17f186fe44d1ad50282

If that's possible, I would very much appreciate having this patch on
stable. I guess most users boot from the main menu but I plan to use
submenus on a project.

Thanks!
-- System Information:
Debian Release: 12.9
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-30-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages tuned depends on:
ii  dbus                  1.14.10-1~deb12u1
ii  ethtool               1:6.1-1
ii  gawk                  1:5.2.1-2
ii  polkitd               122-3
ii  procps                2:4.0.2-3
ii  python3               3.11.2-1+b1
ii  python3-dbus          1.3.2-4+b1
ii  python3-gi            3.42.2-3+b1
ii  python3-linux-procfs  0.6.3-1.1+b2
ii  python3-pyudev        0.24.0-1
ii  virt-what             1.25-1

Versions of packages tuned recommends:
ii  dmidecode       3.4-1
ii  hdparm          9.65+ds-1
ii  iproute2        6.1.0-3
ii  kmod            30+20221128-1
ii  linux-cpupower  6.1.124-1

tuned suggests no packages.

-- Configuration Files:
/etc/tuned/active_profile changed:
realtime

/etc/tuned/bootcmdline changed:
TUNED_BOOT_CMDLINE="skew_tick=1 isolcpus=managed_irq,domain, 
intel_pstate=disable nosoftlockup tsc=reliable"
TUNED_BOOT_INITRD_ADD=""

/etc/tuned/profile_mode changed:
manual


-- no debconf information
>From e9f0f228b3a452d6575ab17f186fe44d1ad50282 Mon Sep 17 00:00:00 2001
From: Yoann Congal <yoann.con...@smile.fr>
Date: Mon, 27 Jan 2025 11:56:50 +0100
Subject: [PATCH] bootloader: export Grub variables to make them available in
 submenus

Without exporting the grub variables, they are only available in the
main grub menu[0]. When descending in a submenu (like in default Debian for
example), tuned_* variable are expanded to the empty string and, so,
tuned kernel cmdline tuning is effectively disabled.

With the export, variables are available in submenus and tuned tuning is
applied as expected.

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094201#10

Signed-off-by: Yoann Congal <yoann.con...@smile.fr>
---
 00_tuned | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/00_tuned b/00_tuned
index 4a14be6..86938ce 100644
--- a/00_tuned
+++ b/00_tuned
@@ -26,4 +26,6 @@ tuned_bootcmdline_file=$tunedcfgdir/bootcmdline
 . $tuned_bootcmdline_file
 
 echo "set tuned_params=\"$TUNED_BOOT_CMDLINE\""
+echo "export tuned_params"
 echo "set tuned_initrd=\"$TUNED_BOOT_INITRD_ADD\""
+echo "export tuned_initrd"

Reply via email to